banner image
Sedang Dalam Perbaikan

We define a connection for URL and JDBC


how do we load a driver and how do we define a connection for URL and JDBC

 Load Driver
 Need to load suitable driver for underlying database.
 Different drivers & types for different databases are available.
 For MS Access, load following driver available with j2se.
Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);
 For Oracle, load the following driver. You have to download it explicitly.
Class.forName(“oracle.jdbc.driver.OracleDriver”); Define Connection URL To get a connection, we need to specify the URL of a database (Actually we need to specify the address of the database which is in the form of URL) As we are using Microsoft Access database and we have loaded a JDBC-ODBC driver. Using JDBC-ODBC driver requires a DSN which we have created earlier and named it personDSN. So the URL of the database will be
We define a connection for URL and JDBC We define a connection for URL and JDBC Reviewed by MCH on April 27, 2014 Rating: 5

No comments:

Powered by Blogger.