|
| Advance Java | IndianTechnoEra |
As there multiple type of database that can be use in JDBC so we need those database and driver connector both which database we are going to use.
We need JDK and an environment like Eclipse IDE for Enterprise Java and Web Developers to Environment
Download DB &Connector:
MySQL:
ORACLE:
SQL Server
PostgreSQL
How to load or set Driver?
There are Two ways to load the jar file:
- Paste the .jar file in jre/lib/ext folder
- Set classpath
Paste the '.jar' file
Firstly, search the your loader driver .jar file then go to JRE/lib/ext folder and paste the jar file here.
Set classpath:
There are two ways to set the classpath:
- temporary
- permanent
Temporary set classpath:
How to set the temporary classpath:
Firstly, search the driver loader .jar file then open command prompt and write:
C:>set classpath=c:\folder\myJDBCDriver.jar;.;
Note: The above given dir is the directory of existing driver loader you can change where your driver loader exist
Permanent set classpath:
How to set the permanent classpath:
Go to environment variable then click on new tab.
In variable name write classpath and in variable value paste the path to ojdbc14.jar by appending ojdbc14.jar;.; as C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jar;.;
