File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes about odbc connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "about odbc connection" Watch "about odbc connection" New topic

about odbc connection

Jhedzkie Skies
Ranch Hand

Joined: Oct 28, 2009
Posts: 118
hi there.. i'm quite new to database programming with java.. and i wonder... about this connection code...

i see here the part DBQ=c:/SalesInventory.mdb

what if i am to redistribute my software package? it will probably change place...
and for example, i would put the .mdb file within the resources of my .jar application, how can i access it?
i mean, how can i access the resources of my app through code? i already tried the getClass().getResource() its no error but it cant get the database. please help..
all i want to know is how to access the database on the resources... like in VB of the code thanks. :)
Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489


As far as i know, the only way to connect the access database is through ODBC..
the code is shown as you've already mentioned...
Java is really different with VB, you should configure URL database correctly..


Sorry, perhaps my english language isn't too good.. Prepare for SCJP 6, Please God help me.. ☼
References : [Java.Boot] [JavaChamp] [JavaPrepare]
Jhedzkie Skies
Ranch Hand

Joined: Oct 28, 2009
Posts: 118
so it wont work..

it must be pre-configured on the program itself to make it work.. too bad...
thanks anyways for the help...
i would still like to figure out how to make this one work.
Jhedzkie Skies
Ranch Hand

Joined: Oct 28, 2009
Posts: 118

i see here again another code... and it has no path... what does this mean? :O
I agree. Here's the link:
subject: about odbc connection
It's not a secret anymore!