Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Type-2 Driver

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
No more fooling around. Read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic