How do I retrieve a whole row of data at once, instead of calling an individual ResultSet.getXXX method for each column?



How do I retrieve a whole row of data at once, instead of calling an individual ResultSet.getXXX met..

Answer / Sudhanshu Bajpai

To retrieve an entire row of data at once in JDBC, you can use the `ResultSet.getArray(int)` or `ResultSet.getObject(int)` methods which return a `java.sql.Array` or `java.sql.Object` respectively for that column. For SQL Server, you can also use the `SqlData` interface to retrieve complex types such as `UserDefinedTypes`.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JDBC Interview Questions

How to move the cursor in scrollable resultset ?

1 Answers  


What is database null and Java null?

1 Answers  


What is a merge field?

1 Answers  


What is Type-1 Driver and when this driver is used?

3 Answers  


what are design patterns?

3 Answers   CFC, TCS, Wipro,


What is statement and preparedstatement in java?

1 Answers  


Is jdbc object oriented?

1 Answers  


What is a jdbc connection?

1 Answers  


What is the use of JDBC DriverManager class?

1 Answers  


How can I get or redirect the log used by DriverManager and JDBC drivers?

1 Answers  


Where can I find info, frameworks and example source for writing a JDBC driver?

1 Answers  


Why would you use setautocommit(false) in jdbc?

1 Answers  


Categories