By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,411 Members | 597 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,411 IT Pros & Developers. It's quick & easy.

Oracle and Java Connectivity!!!

P: 4
How to connect Oracle with JAVA.will u Plz explain me.
Jul 4 '07 #1
Share this Question
Share on Google+
2 Replies

10K+
P: 13,262
How to connect Oracle with JAVA.will u Plz explain me.
Check the directory
oraclexe\app\oracle\product\10.2.0\server\jdbc\lib
or something like it and see if you have any of the following zip files
ojdbc14
or
ojdbc14_g
If you don't have them, then go the oracle site and download them (You just need one of them).
Once you have them, add their path to your classpath and then connect to the database using jdbc
Jul 4 '07 #2

100+
P: 201
How to connect Oracle with JAVA.will u Plz explain me.
Hi

There are many ways to connect to database. For begainers you should use the Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); driver.

Now go to control panel open odbc, create a sytem DSN, new write a name Learning and select the oracle driver.

after that use the Connection class
String url = "jdbc:odbc:Learning";//Learning is DSN Name
java.sql.Connection c = DriverManager.getConnection(url,"Learning", "Learning");

For details read following article
http://www.javacoffeebreak.com/articles/jdbc/
Jul 4 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.