Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2007

Tip: Looking for answers? Try searching our database.

How to connect Java application with Oracle Database using JDBC?

Thread view: 
dilip - 31 Aug 2007 10:41 GMT
Hi friends ,
Myself dilip while learning java, JDBC:ODBC bridge to connect java
application with Ms-Access we easily do using
DriverManager,Connection,Statement,PreparedStatement,ResultSet,
ResultSetMetaData.
But when i try to connect java program to Oracle it's gives a number
of errors.please ,If anyone has appropriate solution to this provide
me.
Thanks .
Dilip Kumar
http://www.intelcs.com/IT-Companies/
DRS.Usenet@sengsational.com - 31 Aug 2007 19:52 GMT
public OracleConnection connect() throws Exception {
String connectString =
"jdbc:oracle:thin:@some.server.name:someportnumber:somedatabasename";
OracleDriver driver = new OracleDriver();
driver = null;
Class.forName ("oracle.jdbc.driver.OracleDriver");
con = (OracleConnection)
DriverManager.getConnection(connectString,userid, password);
con.setAutoCommit(false);
return con;
}

You need to find a copy of classes12.jar.

--Dale--
Lew - 31 Aug 2007 22:04 GMT
> public OracleConnection connect() throws Exception {
> String connectString =
[quoted text clipped - 9 lines]
>
> You need to find a copy of classes12.jar.

Make that ojdbc14.jar at a minimum.  ojdbc5.jar and ojdbc6.jar are also available.

<http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_111060.html>

It's not good to recommend obsolete tech.

Signature

Lew

DRS.Usenet@sengsational.com - 28 Sep 2007 17:02 GMT
> DRS.Use...@sengsational.com wrote:
> > You need to find a copy of classes12.jar.
[quoted text clipped - 4 lines]
>
> It's not good to recommend obsolete tech.

But it's okay as long as folks like you are around to keep me honest!

Thanks, by the way, since I was having a memory issue with TTCItem and
I'll bet more current Oracle code will have fixed that bug... on my
way to your link right now to see if that's the case.

--Dale--
Roedy Green - 01 Sep 2007 14:04 GMT
>But when i try to connect java program to Oracle it's gives a number
>of errors.please ,If anyone has appropriate solution to this provide
>me.

see http://mindprod.com/jgloss/jdbc.html#CONNECTING
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.