This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

" jdbc : odbc : " + something. what is this something?

 
Arul Jose
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when we use write url for jdbc, we write like this.

String url = "jdbc : odbc : "+something.

this something is the data source name. how to write it for ms access.

any one to help?

arul jose.
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"something" is name of your ODBC datasource.
 
Arul Jose
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you give an example for how to write it?
 
sandip mense
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arul,
Basically you need to point to the mdb file. The code would be like this.
String testDB = "e:\\TestDatabase.mdb";
String fullConnectionString = "jdbc: odbc: driver={Microsoft Access Driver (*.mdb)};DBQ=" + testDB ;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection(fullConnectionString);

Regards,

Sandip
 
Arul Jose
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you sandip.

ive got it.

String db = "C:\\Documents and Settings\\Aruljose\\Desktop\\db.mdb";
String url = "jdbc dbc river={Microsoft Access Driver (*.mdb)};DBQ=" + db ;

jose.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic