Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

types of drivers

 
venkat
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please send the connection code for all 4 drivers.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Connection code is always the same regardless of Driver version, vendor and type, that's the point.

Please see the warning on your display name here, your account is about to be deleted.
 
ganesh narayana
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friend,

only the driver and URL differes from one type to second type.

type1

driver : sun.jdbc.odbc.JdbcOdbcDriver
url : jdbc dbc:<<dsn name>>

type 2 for oracle

driver : oracle.jdbc.driver.OracleDriver
url : jdbc racle ci8:@

type 4 for oracle

driver : oracle.jdbc.driver.OracleDriver
url : jdbc racle:thin:@localhost:1521:<<oracle SID>>


then use Class.forName(driver name)
Connection con=DriverManager.getConnection(url,username,password)

for example :

Class.forName(oracle.jdbc.driver.OracleDriver)
Connection con=DriverManager.getConnection("jdbc racle:thin:@localhost:1521:<<oracle SID>>","scott","tiger");




to connect to the specific database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic