Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JDBC what is the difference between resultset and rowset?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Nagendran
what is the difference between resultset and rowset?
1 Answer(s)      2 years and 5 months ago
Posted in : JDBC


what is the difference between resultset and rowset? define the resultset? define the rowset? define resultsetmetadate? i want to dispaly tables of a database how do i do it? can you explain connection factory class? what is databasemetadata? define meta data? all java dirver?


Advertisement
View Answers

May 9, 2012 at 1:11 PM


Difference between ResutSet and Rowset:

1)The ResultSet does not contain all the data from your query. Since it has a connection to the database, when you run the next() method if the ResultSet needs more data it can go to the database and get it.While the RowSet can't do that since it isn't connected to the database so it must load and hold all the data from your query as soon as you run the execute() method.

2)ResultSet is connected and not serializable but RowSet is disconnected and serializable.

ResultSet: ResultSet is a java object that is used for database connectivity to hold the data returned by a select query. When we run a select query, it returns us the data with each row representing one logical group of data with a number of columns. JDBC ResultSet Example

RowSet: A RowSet object contains a set of rows from a result set or some other source of tabular data, like a file or spreadsheet. Because a RowSet object follows the JavaBeans model for properties and event notification, it is a JavaBeans component that can be combined with other components in an application. As is true with other Beans, application programmers will probably use a development tool to create a RowSet object and set its properties. JDBC RowSet Example

ResultSetMetaData: ResultSetMetaData is a class which provides information about a result set that is returned by an executeQuery() method. JDBC details interrogation can be done by using ResultSetMetaData. It includes the information about the names of the columns, number of columns, data type they contain etc. ResultSetMetaData Example

Java Display Tables of Database

ConnectionFactory Class:A ConnectionFactory object encapsulates a set of connection configuration parameters that has been defined by an administrator. A client uses it to create a connection with a JMS provider.

DatabaseMetadata:DatabaseMetaData provides comprehensive information about the database. This interface is implemented by the driver vendors to allow the user to obtain information about the tables of a relational database as a part of JDBC application. User can use this interface to deal with various underlying DBMSs.

Metadata: Metadata is data about data.It is the information that describes about structure and properties of our data. When we define a table we specify each columns name, type of data it holds and restrictions imposed (Constraints) and who owns it. This Information in JDBC Context is called MetaData.

JDBC Drivers



Related Tutorials/Questions & Answers:
Advertisements
 

 

 

DMCA.com