Code example for SQLiteCursor

Methods: moveToFirst, moveToPrevious

0
				} 
				return index + 1;
			} 
 
			public boolean first() throws SQLException { 
				return cursor.moveToFirst();
			} 
 
			public Array getArray(int columnIndex) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Array getArray(String columnName) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public InputStream getAsciiStream(int columnIndex) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public InputStream getAsciiStream(String columnName) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public BigDecimal getBigDecimal(String columnName) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public InputStream getBinaryStream(int columnIndex) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public InputStream getBinaryStream(String columnName) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Blob getBlob(int columnIndex) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Blob getBlob(String columnName) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public boolean getBoolean(int columnIndex) throws SQLException {
				return this.getInt(columnIndex) != 0;
			} 
 
			public boolean getBoolean(String columnName) throws SQLException {
				return this.getBoolean(this.findColumn(columnName));
			} 
 
			public byte getByte(int columnIndex) throws SQLException {
				try { 
					return (byte)this.getShort(columnIndex);
				} 
				catch (ClassCastException e) { throw new SQLException (e.getMessage()); }
			} 
 
			public byte getByte(String columnName) throws SQLException {
				return this.getByte(this.findColumn(columnName));
			} 
 
			public byte[] getBytes(int columnIndex) throws SQLException {
				return cursor.getBlob(this.alterColumnIndex(columnIndex));
			} 
 
			public byte[] getBytes(String columnName) throws SQLException {
				return this.getBytes(this.findColumn(columnName));
			} 
 
			public Reader getCharacterStream(int columnIndex) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Reader getCharacterStream(String columnName) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Clob getClob(int columnIndex) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Clob getClob(String columnName) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public int getConcurrency() throws SQLException { 
				return ResultSet.CONCUR_UPDATABLE;
			} 
 
			public String getCursorName() throws SQLException {
				return cursor.toString();
			} 
 
			public java.sql.Date getDate(int columnIndex) throws SQLException {
				try { 
					String string = this.getString(columnIndex);
					return (string == "NULL" || string == null ? null : java.sql.Date.valueOf(string.substring(0, 10)));
				} catch (NumberFormatException e) { throw new SQLException (e.getMessage()); }
			} 
 
			public java.sql.Date getDate(String columnName) throws SQLException {
				return this.getDate (this.findColumn(columnName));
			} 
 
			public java.sql.Date getDate(int columnIndex, Calendar cal) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public java.sql.Date getDate(String columnName, Calendar x) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public double getDouble(int columnIndex) throws SQLException {
				return this.cursor.getDouble(this.alterColumnIndex(columnIndex));
			} 
 
			public double getDouble(String columnName) throws SQLException {
				return this.getDouble(this.findColumn(columnName));
			} 
 
			public int getFetchDirection() throws SQLException { 
				return ResultSet.FETCH_FORWARD;
			} 
 
			public int getFetchSize() throws SQLException { 
				return this.cursor.getCount();
			} 
 
			public float getFloat(int columnIndex) throws SQLException {
				return this.cursor.getFloat(this.alterColumnIndex(columnIndex));
			} 
 
			public float getFloat(String columnName) throws SQLException {
				return this.getFloat(this.findColumn(columnName));
			} 
 
			public int getInt(int columnIndex) throws SQLException {
				return this.cursor.getInt(this.alterColumnIndex(columnIndex));
			} 
 
			public int getInt(String columnName) throws SQLException {
				return this.getInt(this.findColumn(columnName));
			} 
 
			public long getLong(int columnIndex) throws SQLException {
				return this.cursor.getLong(this.alterColumnIndex(columnIndex));
			} 
 
			public long getLong(String columnName) throws SQLException {
				return this.getLong(this.findColumn(columnName));
			} 
 
			public ResultSetMetaData getMetaData() throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Object getObject(int columnIndex) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Object getObject(String columnName) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Object getObject(int columnIndex, Map<String, Class<?>> x) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Object getObject(String columnName, Map<String, Class<?>> x) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Ref getRef(int columnIndex) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Ref getRef(String columnName) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public int getRow() throws SQLException { 
				return this.cursor.getPosition() + 1;
			} 
 
			public short getShort(int columnIndex) throws SQLException {
				return this.cursor.getShort(this.alterColumnIndex(columnIndex));
			} 
 
			public short getShort(String columnName) throws SQLException {
				return this.getShort(this.findColumn(columnName));
			} 
 
			public Statement getStatement() throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public String getString(int columnIndex) throws SQLException {
				return this.cursor.getString(this.alterColumnIndex(columnIndex));
			} 
 
			public String getString(String columnName) throws SQLException {
				return this.getString(this.findColumn(columnName));
			} 
 
			public Time getTime(int columnIndex) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Time getTime(String columnName) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Time getTime(int columnIndex, Calendar x) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Time getTime(String columnName, Calendar x) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Timestamp getTimestamp(int columnIndex) throws SQLException {
				try { 
					SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
					String string = this.getString(columnIndex);
					Date date = (string == "NULL" || string == null) ? null : format.parse(string);
					return date == null ? null : new Timestamp (date.getTime());
				} catch (ParseException e) { return null; }
			} 
 
			public Timestamp getTimestamp(String columnName) throws SQLException {
				return this.getTimestamp(this.findColumn(columnName));
			} 
 
			public Timestamp getTimestamp(int columnIndex, Calendar x) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public Timestamp getTimestamp(String columnName, Calendar x) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public int getType() throws SQLException { 
				return ResultSet.TYPE_SCROLL_INSENSITIVE;
			} 
 
			public URL getURL(int columnIndex) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public URL getURL(String columnName) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public InputStream getUnicodeStream(int columnIndex) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public InputStream getUnicodeStream(String columnName) throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public SQLWarning getWarnings() throws SQLException {
				throw new NotImplemented(); 
			} 
 
			public void insertRow() throws SQLException { 
				throw new NotImplemented(); 
			} 
 
			public boolean isAfterLast() throws SQLException { 
				return this.cursor.isAfterLast();
			} 
 
			public boolean isBeforeFirst() throws SQLException { 
				return this.cursor.isBeforeFirst();
			} 
 
			public boolean isFirst() throws SQLException { 
				return this.cursor.isFirst();
			} 
 
			public boolean isLast() throws SQLException { 
				return this.cursor.isLast();
			} 
 
			public boolean last() throws SQLException { 
				return this.cursor.moveToLast();
			} 
 
			public void moveToCurrentRow() throws SQLException { 
				throw new NotImplemented(); 
			} 
 
			public void moveToInsertRow() throws SQLException { 
				throw new NotImplemented(); 
			} 
 
			public boolean next() throws SQLException { 
				return this.cursor.moveToNext();
			} 
 
			public boolean previous() throws SQLException { 
				return this.cursor.moveToPrevious();
			} 
 
			public void refreshRow() throws SQLException { 
				throw new NotImplemented(); 
			}