Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
|
Java Databases Discussion specific to working with Java Databases. For other Java topics, please see related Java forums. For database discussions not specific to Java, please see the Database category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 31st, 2004, 12:46 AM
Registered User
 
Join Date: Dec 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default connection to oracle thru jdbc

hello guys,
i want to connect to an oracle 8i database through jdbc. i have jdk1.4 version and iam using the ojdbc14.jar driver for that.

firtly, i want to know if i ca do this (cosidering the oracle8i and jdk1.4 versions go together?)

secondly, if it is possible what url sould i use in the DriverManager.connection();

thanks and regds
venki

 
Old January 13th, 2005, 08:27 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

http://www.javamug.org/mainpages/J2EE.html

Gokulan Ethiraj
 
Old January 13th, 2005, 08:34 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

http://servlet.java.sun.com/products/jdbc/drivers

http://java.sun.com/developer/online...dbcrowsets.pdf

Gokulan Ethiraj
 
Old February 7th, 2005, 10:03 AM
Authorized User
 
Join Date: Feb 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Sandz
Default

Well yes they SHOULD BE COMPATIBLE.
There are two ways by which you can do this.

1. Use the tnsnames file in the Oracle/network/admin folder to get all the access reqd information and use the following form:
Class.forName("sun.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:thin:@host: port:database name","username","password");
The data of host(or ip),port,database name and username will be in the tnsnames file.



2. Second Form: This is a general (default) way
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection Con=DriverManager.getConnection "jdbc:odbc:driver","username","password");


Hope it helps.


Sandz
 
Old February 26th, 2005, 07:49 AM
Registered User
 
Join Date: Feb 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i think u have to wrtie this for load drvier
Class.forName("oracle.jdbc.driver.OracleDriver");

And for getting connection object u have write this
conn = DriverManager.getConnection("jdbc:oracle:thin:@ipa ddress:port:dbname","username", "passwd.");

here
ipaddress may any ip like = 192.9.456.36
port = 1234

may this is helpful to u.


 
Old April 6th, 2005, 06:05 AM
Registered User
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to swaminathanb
Default

Hi
Even i have the same problem while connecting with Oracle database..Im developing a Knowledge Base as my final sem MCA project..I'm using Oracle 9i as database..the error message what i encounter is Dtabase driver not found..
Java.lang.ClassNotFoundException: Oracle.jdbc.driver.OracleDriver

Do i need to set and classpath, if yes! to which file should i set the path..
Pls help me on this..



B.Swaminathan
Mobile:+91 9886510453





Similar Threads
Thread Thread Starter Forum Replies Last Post
how do you configure jdbc connection saf01 Crystal Reports 0 September 12th, 2005 07:24 AM
Connection to Oracle via JDBC swaminathanb Java Databases 3 August 9th, 2005 06:37 AM
Accessing ORACLE data from Java, not using JDBC edwin_zhang Java Databases 4 May 5th, 2005 02:46 AM
Jdbc connection to oracle ClassNotFoundException jeffreak Java Databases 1 August 5th, 2004 12:37 AM
Exception connecting to Oracle Database with JDBC celia05es Java Databases 1 March 31st, 2004 04:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.