© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu

Home Placements Interview Questions Java Interview Questions And Answers Java Interview Questions On JDBC Conectivity ▼

Java Interview Questions On JDBC Conectivity

6. What packages are used by JDBC?

Answer
There are at least 8 packages:

  • java.sql.Driver
  • Connection
  • Statement
  • PreparedStatement
  • CallableStatement
  • ResultSet
  • ResultSetMetaData
  • DatabaseMetaData

7. What are three basic types of SQL statements?

Answer

  • Statement
  • callableStatement
  • PreparedStatement

8. What are the flow statements of JDBC?

Answer
A URL string-->getConnection-->DriverManager-->Driver-->Connection-->Statement-->executeQuery-->ResultSet.

9. What are the steps involved in establishing a connection?

Answer

This involves two steps: (1) loading the driver and (2) making the connection

10. How can you load the drivers?

Answer
Loading the driver or drivers you want to use is very simple and involves just one line of code. If, for example, you want to use the JDBC-ODBC Bridge driver, the following code will load it:

Eg. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Your driver documentation will give you the class name to use. For instance, if the class name is jdbc.DriverXYZ , you would load the driver with the following line of code:

E.g. Class.forName("jdbc.DriverXYZ");
Previous Next
1 2 3 4 5 6 7 8
SLogix Student Projects
bottom