36 Important JDBC Interview Question and Answers


  1. What is JDBC and JDBC Driver?

  2. What are four types of JDBC driver?

  3. Are all the required JDBC drivers to establish connectivity to my database part of the JDK?

  4. What is the fastest type of JDBC driver?

  5. What's new in JDBC 4.0?

  6. What causes the "No suitable driver" error?

  7. What are the steps involved in establishing a JDBC connection?

  8. Why isn't the java.sql.DriverManager class being found?

  9. What are the common steps to execute a Query in JDBC?

  10. How can you load the drivers?

  11. How can you make the connection?

  12. What is Connection pooling in JDBC?

  13. Why do one get a NoClassDefFoundError exception when I try and load my driver?

  14. Why sometimes programmer gets the error message “java.sql.DriverManager class” not being found? How can we remove these kind of errors?

  15. What are the different types of Statements?

  16. What does setAutoCommit do?

  17. How can you use PreparedStatement?

  18. What is a ResultSet?

  19. What will Class.forName do while loading drivers?

  20. How can you move the cursor in scrollable resultsets?

  21. How can you retrieve data from the ResultSet?

  22. What are the steps involved in establishing a JDBC connection?

  23. How do I retrieve warnings?

  24. How can you create JDBC statements and what are they?

  25. How do you call a stored procedure from JDBC?

  26. How can you move the cursor in scrollable resultsets?

  27. What is the difference between TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE?

  28. How to Make Updates to Updatable ResultSets?

  29. What is the difference between client and server database cursors?

  30. Are prepared statements faster because they are compiled? if so, where and when are they compiled?

  31. What advantage is there to using prepared statements if I am using connection pooling or closing the connection frequently to avoid resource/connection/cursor limitations?

  32. Can I reuse a Statement or must I create a new one for each query?

  33. How do you convert a java.sql.Timestamp to a java.util.Date?

  34. What do you understand by connection timeout intervaal ?

  35. What is the difference between setMaxRows( ) and SetFetchSize()?

  36. What is the difference between the JDBC and Java Transaction API(JTA) ?



Enter your email address to get our daily JOBS & INTERVIEW FAQ's Straight to your Inbox.

Make sure to activate your subscription by clicking on the activation link sent to your email