Welcome

JDBC Tutorial


JDBC Scrollable Resultset

     ResultSet Object is a container for given SQL Query. It contains SQL Query Data, and also describing each column(i.e metadata). By Default ResultSet rows navigated in Forward Directions, and it also possible to make ResultSet rows scrollable in Forward or Reverse Direction or moving to exact position etc.,. This is possible changing perameters at CreateStatement or Prepared Statement methods.

ResultSet Types
ResultSet TypeRemarks
ResultSet.TYPE_FORWARD_ONLY Result Set Object is read only.Cusror with in the Resultset moves only forward direction.
ResultSet.TYPE_SCROLL_INSENSITIVEResult Set Object is scrollable and Data with in ResultSet not updatable
ResultSet.TYPE_SCROLL_SENSITIVEResult Set Object is scrollable and Data with in ResultSet may be updatable

resultSetConcurrency a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE

ResultSet Concurrency
ResultSet Concurrency TypeRemarks
ResultSet.CONCUR_READ_ONLY Result Set Object is read only.Cusror with in the Resultset moves only forward direction.
ResultSet.CONCUR_UPDATABLEResult Set Object is scrollable and Data with in ResultSet updatable

ResultSet.CLOSE_CURSORS_AT_COMMIT; ResultSet.HOLD_CURSORS_OVER_COMMIT

ResultSet Holdability
ResultSet Holdability TypeRemarks
ResultSet.CLOSE_CURSORS_AT_COMMIT If ResultSets with this Holdability, will be closed on committing the transaction
ResultSet.HOLD_CURSORS_OVER_COMMITIf ResultSets with this Holdability, will be open on committing the transaction


ResultSet Object has following methods for scrolling rows back and forth, moving to absolute location, update a row,delete a row etc.,

	boolean previous() 
	boolean first() 
	boolean last() 
	boolean absolute(int row) 
	boolean relative(int rows)
	void afterLast()
	void afterLast() 
	void beforeFirst() 
	void moveToCurrentRow() 
	void moveToInsertRow() 
	boolean isFirst() 
	boolean isBeforeFirst() 
	boolean isLast() 
	boolean isAfterLast() 
	int getRow() 
	

ADS