How to find the column count in resultset?
Answer / babu h m
We need to use MetaData option on the ResultSet in order to
get the column count
ResultSet xSet = stmt.executeQuery() ;
ResultSetMetaData rsMetaData = xSet.getMetaData() ;
int numOfColumns = rsMetaData.getColumnCount() ;
Is This Answer Correct ? | 12 Yes | 2 No |
Hi my doubt is that preparedStatement is a interface means which has no implemenation.plz go thru the code below String sql = "SELECT * FROM movies WHERE year_made = ?"; prest = con.prepareStatement(sql); prest.setInt(1,2002); ResultSet rs1 = prest.executeQuery(); Now setInt and executeQuery how it works since it is interface it does not have implementation how it works, how executeQuery returns result from database as executequery method has no implementation even in Statement interface.
4 Answers Cybermate, Hexaware,
What are 4 drivers available in JDBC? At what situation are four of the drivers used?
Write a program JDBCcode forfetching student database with SQL.
What are the jdbc drivers in java?
any one can explain about policy file rule? when i connect database with applet then ther is no compile time error but the run time error is occureed.i.e access is denied.policy file rule is related to this problem.
What are different types of ResultSet?
How do you know which driver is connected to a database?
What is the difference between triggers and procedures?
What is jdbc thin client in oracle?
What is serialization and deserialization in java programming?
How can we store the file in the oracle database?
How vendor Naming registry supports JNDI?