There was a problem sending you an sms. Check your phone number or try again later.
We've sent a link to the Scribd app. If you didn't receive it, try again.
SQL is a language used to create, manipulate, examine and manage relational databases. SQL was standardized in 1992 so that a program could communicate with most database systems without having to change the SQL commands. Unfortunately you must connect to a database before sending SQL commands and each database vendor has a different interface as well as different extensions of SQL
Microsoft ODBC API offers connectivity to almost all databases on almost all platforms and is widely used programming interface for accessing relational databases. But ODBC cannot be directly used with Java Programs due so various reasons and hence JDBC. JDBC does the following things:
a) establish connection with a database
b) send SQL statements
c) processes the results
c) ODBC requires manual installation of the ODBC driver manager and driver on all client machines. JDBC drivers are written in java and JDBC code is automatically installable, secure and portable
In this model, the java applet / application interact directly with the database. A JDBC driver is required to communicate with the particular database management system that is being accessed. The SQL statements are sent to the database and the results are given to the user. This type of model is referred to as the client / server configuration where user is the client and the machine that has the database is called the server.
a) Collection of SQL statements from the client and handing over the same to the DB
b) Receiving results from the DB to the client
c) Maintaining control over accessing and updating of the data.
Middle tier until recently had been written in C and C++ which enable faster performance. With the introduction of optimizing compilers that translate java byte codes into machine specific code, it is not possible to implement the middle tier in java.
This is a Javasoft Bridge product that provides JDBC access via ODBC drivers. But as we mentioned combining ODBC brings in a lot of drawbacks and limitations. Since the ODBC driver have to be present in all the client machines, this is not suitable for large applications.
This driver converts JDBC calls into calls on the client API for Oracle, Sybase, Informix and other DBMS. But some binary code has to be loaded on all clients like the bridge driver and again not suitable for large applications.
This driver translates JDBC calls into DBMS independent net protocol. A server again translates this protocol into a DBMS protocol. This net server middleware connects its pure java clients to many different databases. The type of protocol in this middleware depends on the vendor.
The DriverManager class is the primary class that has the driver information. Whenever a driver is loaded, it registers with the DriverManager class. This class enables selection of the same whenever there is a request for connection to the Database. This class has the method getConnection ().
detailed information about the structure and capabilities of the database.
CreateStatement() \u2013 creates a SQL PreparedStatement object using a SQL string.
PrepareCall() \u2013 creates a SQL CallableStatement object using a SQL string.
A connection session includes the SQL statements that are executed and the results that are returned over that connection. A single application can have one or more connections with a single database or it can have connections with multiple databases.
code with load it:
For a Oraclei Driver you would use
You need for create an instance of the Driver and register it with the Driver Manager because calling Class.forName() will do that for u automatically. If you were to create ur own instance, you would be creating an unnecessary duplicate, but with no harm and u do it the following way
When u have loaded a driver, it is available for making a connection with a DBMS.
Making the Connection
recognize it and establish the connection. It would be jdbc:<subprotocol>:<subname>.
The protocol in JDBC is always JDBC
The normal way in Oracle8 would be
String url = \u201cjdbc:odbc:Oracle8\u201d
Once we have connected to the database, we can request information on the names of the tabes and the names and contents of their columns and we can run SQL statements that either query the database or add to or modify its contents. The objects that we can use to obtain information from the database are:
The Statement Interface defines methods that are used to interact with databases via the excution of the SQL statements. These methods also support the processing of query results returned via ResultSet objects and provide control over the mechanics of query processing.
Now bringing you back...
Does that email address look wrong? Try again with a different email.