steps to connect with Oracle Databse using TYPE-2 Jdbc driver.
Answer Posted / nigel
[NOTE: This description is for oracle 10g]
Step 1: Set the classpath to the oracle driver in your
oracle_home directory
eg:CLASSPATH=C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jar;
Step 2: USE -- Class.forName("oracle.jdbc.OracleDriver");
Step 3: USE jdbc url =
("jdbc:oracle:oci:USERNAME/PASSWORD@localhost:1521:XE");
In My Case it was : USERNAME=hr PASSWORD=hr
The rest of the code is similar to jdbc:odbc connection.
just compile and run the code.....:D
| Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
What is an i/o filter?
How can we make a class virtual?
What happens if constructor is private?
Is there any limitation of using inheritance?
What is numeric data type?
What is an argument java?
What is a vararg?
How do you convert an int to a double in java?
When should we create our own custom exception classes?
What is general methodology?
What does it mean to flush a file?
What is the relationship difference the canvas class and the graphics class?
What is the difference between stringbuffer and stringbuilder class?
Does java set allow duplicates?
Why synchronization is important?