Wednesday, 13 June 2018

JDBC Interview Questions



  • How does JAVA interact with databases?
  • Can we interact with non-relational sources using JDBC?
  • Can you explain in depth the different sections in JDBC?
  • Can you explain in short how you go about using JDBC API in code?
  • How do you handle SQL exceptions?
    • Twist: - (A) Can you explain “SQL Exception” class in detail?
    • Twist: - (A) what is SQL State in SQL Exceptions?
  • If there is more than one exception in SQL Exception” class how to go about displaying it.
  • Explain Type1, Type2, Type3, and Type4 drivers in JDBC?
  • What are the advantages and disadvantages of using JDBC-ODBC bridge driver?
  • What are the advantages and disadvantages of using Native-API/ Partially Java Driver?
  • What are the advantages and disadvantages of using Net-Protocol/ All-Java driver?
  • What are the advantages and disadvantages of using Native-protocol/ All-Java driver
  • Advantages of using JDBC-ODBC bridge driver:-
  • Disadvantages of using JDBC-ODBC bridge driver:-
  • Advantages of using Native-API/ Partially Java Driver:-
  • Dis-advantages of using Native-API/ Partially Java Driver:-
  • Advantages of using Net-Protocol/ All-Java driver:-
  • Disadvantages of using Net-Protocol/ All- Java driver:-
  • Advantages of using Native-protocol/ All-Java driver:-
  • Disadvantages of using Native-protocol/ All-Java driver:-
  • Define meta-data?
  • What is Database Metadata?
  • Can you explain “Connection Factory” class?
  • I want to display tables of a database how do I do it?
  • Define “Result Set Meta Data”?
  • What is the difference between “Result Set” and “Row Set”?
  • Can “Result Set” objects be serialized?
  • Explain “Result Set”, “Row Set”, “Cached Row set”, “JdbcRowset” and “Web Row Set”?
  • What are the different types of result set?
  • Explain the concept of “Prepared Statement “statement interface?
  • What’s the difference between “Statement” and “Prepared Statement”?
  • How can we call stored procedure using JDBC?
  • Can you explain “Callable Statement” interface in detail?
  • How do you get a result set object from stored procedure?
  • How can we do batch updates using “Callable Statement” Interface?
  • Define transactions?
  • What is ACID in transaction?
  • What are the four essential properties of a transaction?
  • Explain concurrency and locking?
  • What are different types of locks?
  • What are the different types of levels of resource on which locks can be placed?
  • Define lock escalation?
  • What is Table level and Row level locking?
  • What are the problems that can occur if you do not implement locking properly?
  • What are different transaction levels?
  • What are different types of locks?
  • What is difference between optimistic and pessimistic locking?
  • What are deadlocks?
  • How can we set transaction level through JDBC API?
  • Can you explain transaction control in JDBC?
  • What are Save points in a transaction?

Best Of Luck.

No comments:

Post a Comment