wood burning stoves 2.0
The moose likes JDBC and Relational Databases and the fly likes Error in First JDBC connection program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Error in First JDBC connection program" Watch "Error in First JDBC connection program" New topic

Error in First JDBC connection program

Shivit Agarwal
Ranch Hand

Joined: Feb 28, 2008
Posts: 82
I have written my first program to connect to Oracle10g database but encountered the error below.

java.sql.SQLException: [Microsoft][ODBC Driver Manager]
Data source name not found and no default driver specified

How to resolve it. Do I need to download some extra drivers ??
What should I do now ??

I have created the table and also inserted the information in SQL.

And My java code

Have the determination of mirror which never fails to reflect in spite of being broken into pieces.<br /> <br />Kiss the hands you cannot bite.<br /> <br />An Optimist is one who starts taking a bath when he accidentally falls into the water.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33106

I don't see anything about Oracle in the source/connection string.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
K Kiran Kumar
Ranch Hand

Joined: Jan 04, 2006
Posts: 109
Hi Shivit,

Have you set your classpath to "ojdbc14.jar"? You need to have this jar file.

Here is some sample code which may be helpful to you. Just try it out.....

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
String url="jdbcracle:thin:@<ip address>:<port>:<database instance>";
con = DriverManager.getConnection(url,"userid","pwd");

I agree. Here's the link: http://aspose.com/file-tools
subject: Error in First JDBC connection program
It's not a secret anymore!