• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Type 4 Java Pure Driver

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I want to connect to my Microsoft SQL 7.0 database and Oracle9i database using Type 4 (Pure Java Driver).Could you please tell me what will be the JDBC URL for both the databases?
Also I want to know whether I have to install any other thing apart from the respective databases.
It will be very nice if you can post me the actual code for the conection.
Regards
Bamby
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cool Bamby
Welcome to the Java Ranch, we hope you�ll enjoy visiting as a regular however, your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!
For the JDBC URL question that is going to depend on the driver you are using for each database. The driver you installed should tell you what connection URL to use or what format it must be in.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)Decide which Driver to be use :
You could use the following :
(a)For Oracle & SQL Server --> Merant SequeLink Server (Type 3) ; Data-Direct Connect for JDBC (Type 4)
(b)For Oracle : Oracle Thin Driver (Type 4)
2) Once DataBase and Driver is decided, u need to know which Class to use and what url to connect to.
(a) In Case you use Merant SequeLink Server :
Class : com.merant.sequelink.jdbc.SequeLinkDriver
URL : jdbc:sequelink://server:19996;user=userid;password=passwd;dataSourceName=SID
(b) In Case you use Oracle Thin Driver :
Class racle.jdbc.driver.OracleDriver
URL :jdbc racle:thin:userid/password@server:1521 racleSID
3) Once you have above info, you can connect to the DataBase, using std code.
String l_class = "oracle.jdbc.driver.OracleDriver";
String l_url = "jdbc racle:thin:userid/password@server:1521 racleSID";
Class.forName( l_class ) ;
Connection conn = DriverManager.getConnection( l_url ) ;
 
Enjoy the full beauty of the english language. Embedded in this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic