Você está na página 1de 5

7/18/2016

JDBC Interview Questions javatpoint

ContentMenu

JDBCInterviewQuestions
A list of frequently asked jdbc interview questions with answers
aregivenbelow.

1)WhatisJDBC?
JDBCisaJavaAPIthatisusedtoconnectandexecutequeryto
the database. JDBC API uses jdbc drivers to connects to the
database.
moredetails...

2)WhatisJDBCDriver?
JDBC Driver is a software component that enables java
application to interact with the database.There are 4 types of
JDBCdrivers:
1. JDBCODBCbridgedriver
2. NativeAPIdriver(partiallyjavadriver)
3. NetworkProtocoldriver(fullyjavadriver)
4. Thindriver(fullyjavadriver)
moredetails...

3) What are the steps to connect to the


databaseinjava?

Registeringthedriverclass
Creatingconnection
Creatingstatement
Executingqueries
Closingconnection
moredetails...

4)WhataretheJDBCAPIcomponents?
http://www.javatpoint.com/jdbcinterviewquestions

1/5

7/18/2016

JDBC Interview Questions javatpoint

The java.sql package contains interfaces and classes for JDBC


API.
Interfaces:
Connection
Statement
PreparedStatement
ResultSet
ResultSetMetaData
DatabaseMetaData
CallableStatementetc.
Classes:
DriverManager
Blob
Clob
Types
SQLExceptionetc.

5)WhataretheJDBCstatements?
Thereare3JDBCstatements.
1. Statement
2. PreparedStatement
3. CallableStatement

6) What is the difference between Statement


andPreparedStatementinterface?
In case of Statement, query is complied each time whereas in
case of PreparedStatement, query is complied only once. So
performanceofPreparedStatementisbetterthanStatement.
moredetails...

7)Howcanweexecutestoredproceduresand
functions?

http://www.javatpoint.com/jdbcinterviewquestions

2/5

7/18/2016

JDBC Interview Questions javatpoint

By using Callable statement interface, we can execute


proceduresandfunctions.

8) What is the role of JDBC DriverManager


class?
The DriverManager class manages the registered drivers. It
can be used to register and unregister drivers. It provides
factorymethodthatreturnstheinstanceofConnection.
moredetails...

9)WhatdoestheJDBCConnectioninterface?
The Connection interface maintains a session with the
database. It can be used for transaction management. It
provides factory methods that returns the instance of
Statement,

PreparedStatement,

CallableStatement

and

DatabaseMetaData.
moredetails...

10)WhatdoestheJDBCResultSetinterface?
TheResultSetobjectrepresentsarowofatable.Itcanbeused
to change the cursor pointer and get the information from the
database.
moredetails...

11) What does the JDBC ResultSetMetaData


interface?
TheResultSetMetaDatainterfacereturnstheinformationoftable
such as total number of columns, column name, column type
etc.
moredetails...

http://www.javatpoint.com/jdbcinterviewquestions

3/5

7/18/2016

JDBC Interview Questions javatpoint

12) What does the JDBC DatabaseMetaData


interface?
The DatabaseMetaData interface returns the information of the
database such as username, driver name, driver version,
numberoftables,numberofviewsetc.
moredetails...

13) Which interface is responsible for


transactionmanagementinJDBC?
The Connection interface provides methods for transaction
managementsuchascommit(),rollback()etc.
moredetails...

14) What is batch processing and how to


performbatchprocessinginJDBC?
By using batch processing technique in JDBC, we can execute
multiplequeries.Itmakestheperformancefast.
moredetails...

15) How can we store and retrieve images


fromthedatabase?
By using PreparedStatement interface, we can store and
retrieveimages.
moredetails...
1

Java

Basics

InterviewQuestions
Java

Multithreading

InterviewQuestions
Java

Collection

http://www.javatpoint.com/jdbcinterviewquestions

Java OOPs Interview


Questions
JavaString&Exception
InterviewQuestions
JDBC

Interview
4/5

7/18/2016

JDBC Interview Questions javatpoint

InterviewQuestions
Servlet

Interview

Questions
Spring

Interview

Interview

Hibernate

Interview

Questions
Interview

Questions
Oracle

JSP
Questions

Questions
PL/SQL

Questions

SQL

Interview

Questions
Interview

Questions
SQL Server Interview
Questions

http://www.javatpoint.com/jdbcinterviewquestions

Android

Interview

Questions
MySQL

Interview

Questions

5/5

Você também pode gostar