Before delving into the solution, let’s take a look at the relationships between important low-level interfaces and classes.
Figure Relationships between important low-level interfaces and classes
To connect to a database, you use an instance of the Connection class. Then, to find out the names of the database tables and fields, you need to get an instance of the DatabaseMetaData class from the connection. Next, to issue a query, you compose the SQL query string and use the Connection to create a Statement class. By executing the statement, you obtain a ResultSet class, and to find out the names of the column rows in that ResultSet, you must obtain an instance of the ResultsetMetaData object.
To obtain the ResultSet metadata, follow these steps:
What does ResultSetMetaData provide? ResultSetMetaData objects can be used to get information about the types and properties of the columns in a ResultSet object. ResultSetMetaData encapsulates the column’s information—such as the number of columns, their names, and the column data type and its precision—contained in a ResultSet. ResultSetMetaData provides many methods to deal with the column’s information; for example, the getColumnName() method of the ResultSetMetaData object returns the column’s name in the ResultSet.
JDBC Related Interview Questions
|Core Java Interview Questions||JSP Interview Questions|
|Java Servlets Interview Questions||EJB(Enterprise JavaBeans) Interview Questions|
|JSTL(JSP Standard Tag Library) Interview Questions||JNDI (Java Naming and Directory Interface) Interview Questions|
|Java Bean Utils Interview Questions||AWT (Abstract Window Toolkit) Interview Questions|
What Is Jdbc Programming?
Database Metadata, Part 1
Database Metadata, Part 2
Exploring Driver Property Information
Rowset Metadata A
Web Access To Metadata,part 1
Web Access To Metadata, Part 2
Rdf And Jdbc Metadata
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.