Please send your Questions & Answers or Feedback to "mohan@javabook.org"

Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection?

No, we can open only one statement object when using JDBC-ODBC Bridge.

What are the locking system in JDBC

One more tough JDBC question to understand and prepare. There are 2 types of locking in JDBC by which we can handle multiple user issue using the record. if two user are reading the same record then there is no issue but what if users are updating the record , in this case changes done by first user is gone by second user if he also update the same record .so we need some type of locking so no lost update.

 

Optimistic Locking: optimistic locking lock the record only when update take place. Optimistic locking does not use exclusive locks when reading

 

Pessimistic locking: in this record are locked as it selects the row to update

What do you mean by cold backup, hot backup?

This question is not directly related to JDBC but some time asked during JDBC interviews. Cold back is the backup techniques in which backup of files are taken before the database restarted. In hot backup backup of files and table is taken at the same time when database is running. A warm is a recovery technique where all the tables are locked and users cannot access at the time of backing up data.

What is connection pooling?

This is also one of the most popular question asked during JDBC Interviews. Connection pooling is the mechanism by which we reuse the recourse like connection objects  which are  needed to make connection with database .In this mechanism client are not required every time make new connection and then interact with database instead of that connection objects are stored in connection pool and client will get it from there. so it’s a best way to share a server resources among the client and enhance the application performance.

How cursor works in scrollable result set?

Another  tough JDBC Interview question, not many Java programmer knows about using Cursor in Java.

in JDBC 2.0 API new feature is added to move cursor in resultset backward forward and also in a particular row .

There are three constant define in result set by which we can move cursor.

·TYPE_FORWARD_ONLY: creates a nonscrollable result set, that is, one in which the cursor moves only forward

·TYPE_SCROLL_INSENSITIVE : a scrollable result set does not reflects changes that are made to it while it is open

·TYPE_SCROLL_SENSITIVE: a scrollable result set  reflects changes that are made to it while it is open

Related Posts Plugin for WordPress, Blogger...
Flag Counter