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

Type-2 Driver

 
shailendra vasale
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all !
Can any help me out for connecting type-2 driver with oracle,I have installed oracle8 personal edition in my computer its working well with odbc(Type one).I have set classpath for OrcaleDriver.
But while using type-2
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc racle:MyDb","scott","tiger");
it throws following exception:
java.sql.SQLException:Sub Protocol must be specified in connection URL
Thankx in advance.

Shailendra.
 
Anil Vupputuri
Ranch Hand
Posts: 527
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by shailendra vasale:
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc: oracle:MyDb","scott","tiger");
it throws following exception:
java.sql.SQLException:Sub Protocol must be specified in connection URL

Yeah, its obviously throws exception. I guess ur using OCI drivers.what is MyDb.
The format should be
protocol:sub-protocol:driver-type:user-name: pwd

jdbc: oracle:driver-type:user/password@database
For a detailed explanation, follow the link,
Goto Oracle .

HTH..
Anil

[This message has been edited by Anil Vupputuri (edited June 14, 2001).]
[This message has been edited by Anil Vupputuri (edited June 14, 2001).]
 
vaibhav punekar
Ranch Hand
Posts: 134
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you just replaced JDBC:ODBC with JDBC:ORACLE keeping DSN name as it is.What Anil suggests is right.There is no DSN name as such Instead we have driver type.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic