• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

JDBC:ODBC bridge for remote access

 
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to know if the JDBC DBC bridge can be used to access a Database on a remote machine. If it can be done, what do I specify in the URL for the DriverManager.getConection() method.

Thanks
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, that works. In the URL you just provide the name of the ODBC data source. That name is set up on your machine in the ODBC control panel; simply point it to a remote data source This works on Windows only, but since Access is Windows-only as well, that may not be a big deal. There's an FAQ here.
 
Zip Ped
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found out a solution to the problem. My MS Access DB is going to be on a Shared drive on my network. So in order to access the DB remotely using the JDBC: ODBC bridge, I need to pass this URL into the getConnection() method :
con = DriverManager.getConnection("jdbc dbc river={MicroSoft Access Driver (*.mdb)};DBQ=C:/data/Access/test1.mdb","dba","sql");

The other way to work around with the problem is to use the RmiJdbc bridge(Type 3 driver) or use the Jackcess Library which is more powerful and portable. But as I am building a small application where the DB server may not be moved, I would be using the JDBC: ODBC bridge itself.
 
reply
    Bookmark Topic Watch Topic
  • New Topic