It's not a secret anymore!*
The moose likes JDBC and the fly likes about odbc connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
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
wood burning stoves
subject: about odbc connection
Similar Threads
DSN less MS access Connection using JSP - help needed
ODBC and JDBC!!!
STORING Resultset in String variable
how to connect MS Access directly
Netbeans and MS Access