• 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

DSN connection

 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so far, i'm connecting directly to oracle using jdbc driver and this is
my connection string which works just fine






now i have a DSN from an RDB and i was wondering how the connection string would be to connect to a DSN and how the driver connection string would also be

also, what driver should be used? would that need a jdbc-odbc driver?
thanks
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The basic steps go like this
1) the first time Class.forName() is called it loads the class
2) when the class loads, it has a static block register itself with the DriverManager
3) When you pass a JDBC URL to the DriverManager, it asks each of the drivers it knows about if they can handle it, when one says 'yes', the DriverManager gets it to return a connection
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
also, what driver should be used? would that need a jdbc-odbc driver?
In general you want to avoid the jdbc-odbc bridge if you can. Microsoft machines have their own generic way of talking to databases called ODBC, and the bridge is a quick and easy way to tap into this. But it only works on windows machines (more or less ) and it isn't production-ready. Also, there is usually a nice type-4 driver available for many databases.
 
Bernard Sigmund Gustav
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what i originally wanted was to connect to oracle rdb from java but that proved too difficult for my knowledge and i don't have the time as of the moment to learn because i need to deploy my project. It still needed some configurations for OpenVMS and a SDK for OpenVMS alpha.

so what i did instead was to create a DSN in MSAccess for my oracle rdb schema and then have java connect to that dsn instead of directly to the rdb.so now, i don't know how to connect or what the connection string should be and what driver should be downloaded for that. i already have ojdbc14.jar but that worked for oracle dbms and not for a DSN or odbc.

thanks
 
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Continued (at great length) and resolved http://forum.java.sun.com/thread.jspa?threadID=724991&messageID=4180231
reply
    Bookmark Topic Watch Topic
  • New Topic