JDBC

JDBC Projects

JDBC Project 1

JDBC Subjective Questions And Answers


Totel:25 Click: 1 2 3 4 5
JDBC Interview Questions And Answers

Page 1

You should have Driver for connectivity .You can download from net .

Do following steps:-

1) Load that driver in your class By help of Class.forNamr(Driver) 

2) Than get the connection Connection con = null; con = DriverManger.getDataBaseConnection(url,user,password).

3) Create statement help of connection Statement st = con.createStatement("Select * From tbl......")

4) Execute Statement ResultSet rs = null; rs= st.execute();

5) Get you result from resultset .

You should have Driver for connectivity .You can download from net .

Do following steps:-

1) Load that driver in your class By help of Class.forNamr(Driver) 

2) Than get the connection Connection con = null; con = DriverManger.getDataBaseConnection(url,user,password).

3) Create statement help of connection Statement st = con.createStatement("Select * From tbl......")

4) Execute Statement ResultSet rs = null; rs= st.execute();

5) Get you result from resultset .

The ResultSet.getXXX methods are the only way to retrieve data from a ResultSet object,which means that you have to make a method call for each column of a row. 

It is unlikely that this is the cause of a performance problem, however, because it is difficult to see how a column could be fetched without at least the cost of a function call in any scenario.

We welcome input from developers on this issue.

Type 1 :- DriversBridge drivers such as the jdbc-odbc bridge.They rely on an intermediary such as ODBC to transfer the SQL calls to the database and also often rely on native code. It is not a serious solution for an application 

Type 2:- DriversUse the existing database API to communicate with the database on the client. Faster than Type 1, but need native code and require additional permissions to work in an applet. Client machine requires software to run. 

Type 3 DriversJDBC-Net pure Java driver. It translates JDBC calls to a DBMS-independent network protocol, which is then translated to a DBMS protocol by a server. Flexible. Pure Java and no native code. 

Type 4 DriversNative-protocol pure Java driver. It converts JDBC calls directly into the network protocol used by DBMSs. 

This allows a direct call from the client machine to the DBMS server. It doesn't need any special native code on the client machine.


Recommended by Sun's tutorial, driver type 1 and 2 are interim solutions where direct pure Java drivers are not yet available.


Driver type 3 and 4 are the preferred way to access databases using the JDBC API, because they offer all the advantages of Java technology, including automatic installation. For more info, visit Sun JDBC page

Type-1     Jdbc-Odbc Bridge Driver

Vendor :Sun Class: sun.jdbc.odbc.JdbcOdbcDriver

Jar: rt.jar

This driver is Database Vendor Independent.

Type-2  Native-API, Partly-Java driver

DB Vendor, Weblogic Servler

oracle.jdbc.driver.OracleDriver

ojdbc14.jar

Faster than any other driver.

Type-3

Java Native Net Protocol Driver

Third party such as IDS

ids.sql.IDSDriver

jdk14drv.jar

No need to depend on DB Vendor jar file.

Type-4

Java to Database protocol

DB Vendor :oracle.jdbc.driver.OracleDriver

ojdbc14.jar

Thin driver.

Other Examples of Type-4 Drivers

1) org.hsqldb.jdbcDriver: For HSQLDB Database.

2) com.mysql.jdbc.Driver : For MYSQL Databse

3) org.postgresql.Driver: For PostGreSQL

4) com.sybase.jdbc2.jdbc.SybDriver: Sybase database

No. 

The JDBC-ODBC Bridge does not support concurrent access from different threads. 

The JDBC-ODBC Bridge uses synchronized methods to serialize all of the calls that it makes to ODBC

Multi-threaded Java programs may use the Bridge, but they won't get the advantages of multi-threading.

 In addition, deadlocks can occur between locks held in the database and the semaphore used by the Bridge.

 We are thinking about removing the synchronized methods in the future. 

They were added originally to make things simple for folks writing Java programs that use a single-threaded ODBC driver.

No. You can open only one Statement object per connection when you are using the JDBC-ODBC Bridge.


Goto Page:

1 2 3 4 5
JDBC Objective Questions And Answers

JDBC Objective Questions And Answers

JDBC Interview Questions And Answers

JDBC Interview Questions And Answers


R4R,JDBC Objective fresher and experienced, JDBC Subjective fresher and experienced ,JDBC Interview Questions And Answers,JDBC fresher and experienced,JDBC Interview fresher and experienced ,JDBC Questions fresher and experienced,JDBC Answers fresher and experienced