|
Class.forname(class) is only to load the
class. Nor for making a connection.
We need to use DriverManager for
conenction.
String url =
"jdbc:oracle:oci8://server:port/DataBase"; // or thin
String driver = "oracle.jdbc.driver.OracleDriver"; //Loding the Database driver
Class.forName(driver); //Connecting to the DB source Connection con =
DriverManager.getConnection(url,"username","passwd");
In some database settings
we need to change the url to
String url =
"jdbc:oracle:oci8://server:port/DataBase;UID=username;PWD=passwd@tnsname_mapping";
Harish
|
- JDBC with oracle tejas patel
- Re: JDBC with oracle Dahnke, Eric
- Re: JDBC with oracle Margaret Fisk
- Re: JDBC with oracle Lindsay, William (USPC.PCT.Hopewell)
- Re: JDBC with oracle and tim... john bell
- Re: JDBC with oracle Margaret Fisk
- Re: JDBC with oracle Godbey, David
- Re: JDBC with oracle Galbreath, Mark
- Re: JDBC with oracle Galbreath, Mark
- Re: JDBC with oracle Harish K Kottarathil
- Re: JDBC with oracle Vijay Naidu
