• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connecting to Database in a jar file

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

I want to access a Database ( access.mdb ) in a jar file(test.jar )and tried to achieve that using following code.

...
String filename = "jdbc:odbc:jar C:/test.jar)access";
String database = "jdbc:odbc:Driver={Microsoft Access Driver *.mdb)};DBQ=";
database += filename.trim() + ";DriverID=22;READONLY=true}";

//get the connection from the DriverManager
con = DriverManager.getConnection( database);
...

Can anybody pls. tell me where I am making mistake? ( any syntax problem in using jar subprotocol? )

Thanks,
Prasad.

[edited to disable smilies]
[ December 01, 2004: Message edited by: Jeanne Boyarsky ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic