Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connecting to Microsoft access using only jdbc

 
Sameera Abeysinghe
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
I connect to sql server using the code shown below.

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");

Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://10.0.0.1:1433;user=m4g62;password=m4g62");
Statement stmt=conn.createStatement( );

Can any one tell me how I can connect to Microsoft access by changing only the code shown below?

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");

Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://10.0.0.1:1433;user=m4g62;password=m4g62");

Thank You.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- you need to use ODBC bridge to connect to Access.
- make a DSN
- include your DSN name in your connection string

cheers
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic