File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Connectivity in Oracle

 
Suvojyoty Saha
Greenhorn
Posts: 25
Firefox Browser Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am trying to test the connection for oracle XE (10g) in Eclipse but i am getting the following Exception

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

I am using the following 10g resease 2 jar ojdbc14.jar and my code is Listed below



I created a USER DSN for Oracle XE and there the connection tests fine. The following driver if replaced with MYSQL Driver also tests fine but not able to get a clue as to what i am doing wrong here.
 
Wendy Gibbons
Bartender
Posts: 1107
Eclipse IDE Oracle VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am going to ask the obvious question, to get it over with,
You can connect using sqlplus with theese details?
 
Swastik Dey
Rancher
Posts: 1601
5
Android Java Java ME
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your connection string and and driver type are contradictory. You are trying to make odbc based connection, on the other hand your driver type is oci driver. Moreover your dsn name is missing in the code. Why not use thin driver?
 
Suvojyoty Saha
Greenhorn
Posts: 25
Firefox Browser Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Wendy I was not sure as to what I was doing. Was not aware that :thin@ needed to be mentioned. Was trying to use the OCIConnection class instead of trying to the driver class from the jar ojdbc14.

Thanks Swastik.

On changing these 2 lines of code i was able to connect.


 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic