File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Arul Jose
Ranch Hand
Posts: 131
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"something" is name of your ODBC datasource.
 
Arul Jose
Ranch Hand
Posts: 131
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic