Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DSN connection

 
Bernard Sigmund Gustav
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • 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
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
Maximilian Xavier Stocker
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Continued (at great length) and resolved http://forum.java.sun.com/thread.jspa?threadID=724991&messageID=4180231
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic