- World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.

Get it now !!
Send your Resume to 6000 Companies
JDBC Interview Questions & Answers - Learning Mode

JDBC Interview Questions & Answers - Learning Mode

Java Database Connectivity (JDBC) is an API for the Java programming language that defines how a client may access a database. It provides methods for querying and updating data in a database. JDBC is oriented towards relational databases.

Try JDBC Interview Questions & Answers - Exam Mode

1 2 3 4 5 6 7 8 9 10 11 Next

Sort By : Latest First | Oldest First | By Rating

JDBC Interview Questions & Answers - Learning Mode
Try JDBC Interview Questions & Answers - Exam Mode
Question: What is Connection Pooling?

Answer: With servlets, opening a database connection is a major bottleneck because we are creating and tearing down a new connection for every page request and the time taken to create connection will be more.

Creating a connection pool is an ideal approach for a complicated servlet. With a connection pool, we can duplicate only the resources we need to duplicate rather than the entire servlet. A connection pool can also intelligently manage the size of the pool and make sure each conne Source:
Question: Which of the following allows non repeatable read in JDBC, connection class?

Question: what is different between tier and 3 tier?

Answer: Question is not correct
if question is 1-tier and 3-tier
then answer his one tier means stand Alon program their is no layers. means program in simple Jsp page with data base connection and display means business logic,view,and their is no back end storage,
3-tier means: separation of front end, business logic, database storage,
Three Layered Application
Question: What Class.forName will do while loading drivers?

Answer: Dynamic loading of Java classes at runtime provides tremendous flexibility in the development of enterprise systems. It provides for the basis of "application servers", and allows even simpler, lighter-weight systems to accomplish some of the same ends. Within Java, dynamic loading is typically achieved by calling the forName method on the class java.lang.Class; however, when Class.forName is naively called from within an Extension, strange errors can occur. This paper describes why those errors Source:
Question: How can I protect my database password ? I'm writing a client-side java application that will access a database over the internet. I have concerns about the security of the database passwords. The client will have access in one way or another to the class files, where the connection string to the database, including user and password, is stored in as plain text. What can I do to protect my passwords?

Answer: This is a very common question.
Conclusion: JAD decompiles things easily and obfuscation would not help you. But you'd have the same problem with C/C++ because the connect string would still be visible in the executable.
SSL JDBC network drivers fix the password sniffing problem (in MySQL 4.0), but not the decompile problem. If you have a servlet container on the web server, I would go that route (see other discussion above) then you could at least keep people from reading/destroying y Source:
Question: How can you retrieve data from the ResultSet?

Answer: Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(SELECT COF_NAME, PRICE FROM COFFEES");
while (rs .next() )
//Iam assuming there are 3 columns in the table.
System.out.println ( rs.getString(1));

//don't forget to close the resultset, statement & connection

rs.close(); //First
stmt.close(); //Second
con.close(); //Last
System.o Source:
Question: Which type of JDBC driver is the fastest one?

Answer: JDBC Net pure Java driver(Type IV) is the fastest driver because it converts the jdbc calls into vendor specific protocol calls and it directly interacts with the database. Source:
Question: Where to use which driver in JAVA?

Answer: The following is some information I could find on web regarding JDBC drivers:

- The following website (not sure about the information) maintains a list of drivers and their use

- A driver can be looked at Sun's website at the following location:

- A JDBC driver is a class that implements the JDBC Driver interface and understands how to convert program (and typically SQL Source:
Question: Which of the statement below does not correctly defines the difference between JDBC and ODBC ?

Answer: ODBC requires manual installation of the ODBC driver manager and driver on all client machines. While for JDBC driver are written in Java and JDBC code is automatically installable, secure and portable on all platforms.
Explanation: because ODBC being a c based interface cannot be directly used with java
Question: What Class.forName( ) method will do?

Answer: Class.forName() will load the class dynamically and it will return the object of type class.
Question: The full form of ODBC is ___________

Question: What is hybernate and spring? can u suggest any books or documents so that i can go through?

Answer: Hibernate offers persistence and OR(Objet-Relational) mapping for Java/J2EE applications helping them improve performance and scalability.

Spring is a light-weight Java framework which paves the way to write faster applications without App Server (or EJB etc.)

There are a plenty of good books on these subjects. Following the most notable amongst them:

Hibernate in Action by Christian Bauer, Gavin King (Hanning)

Better, Faster, Lighter Java by Justin Gehtland, Bruce A. Source:
Question: What is the difference between client and server database cursors?

Answer: The client side is the current row of the cursor which called a Result (ODBC) or ResultSet (JDBC). The cursor is a server-side entity only and remains on the server side. Source:
Question: What are the different types of Statements?

Answer: 1.Statement (use createStatement method)

2. Prepared Statement (Use prepareStatement method)

3. Callable Statement (Use prepareCall). Source:
Question: Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection?

Answer: No. You can open only one Statement object per connection when you are using the JDBC-ODBC Bridge. Source:
Question: The full form of JDBC is _________________

Question: what is savepoint?

Answer: Save point is a feature using which we can save status of the transaction to a perticular that if anytime we have lost a transaction we can get it back using save point. Source:
Question: How can I connect to an Oracle database not on the web server from an untrusted applet?

Answer: You can use the thin ORACLE JDBC driver in an applet (with some extra parameters on the JDBC URL). Then, if you have NET8, you can use the connection manager of NET8 on the web server to proxy the connection request to the database server. Source:
Question: State true or false :- ResultSet.CONCUR_UPDATABLE used with the result set is used to update the rows directly in the database.

Answer: True

Explanation: This is the new feature in the JDBC 2.0 API usage is Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
Question: How to Retrieve Warnings?

Answer: SQLWarning objects are a subclass of SQLException that deal with database access warnings. Warnings do not stop the execution of an application, as exceptions do; they simply alert the user that something did not happen as planned. A warning can be reported on a Connection object, a Statement object (including PreparedStatement and CallableStatement objects), or a ResultSet object. Each of these classes has a getWarnings method, which you must invoke in order to see the first warning reported on Source:

1 2 3 4 5 6 7 8 9 10 11 Next

India News Network
Latest 20 Questions
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
"Holiday Packages" announced as an advertisement are an example of _________: (a) Offer (b) Counter Offer (c) Invitation to Offer (d) None of the above
A match fixing contract between a player and a broker is a: (a) Valid Contract (b) Unenforceable Contract (c) Void Contract (d) Illegal Contract
When a bookseller sells a book on cash payment then it is called as ___________: (a) Unilateral Contract (b) Bilateral Contract (c) Executed Contract (d) Executory Contract
____________ agreements are created by situation: (a) Written (b) Oral (c) Void (d) Implied
Cache = 0.015625 Seconds