[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » JDBC
 
RSS feed
 
New topic
Author

about odbc connection

Jhedzkie Skies
Ranch Hand

Joined: Oct 28, 2009
Messages: 71

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. :)

This message was edited 1 time. Last update was at by Bear Bibeault

Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Messages: 475

Hi..

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..

Thanks..

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
Messages: 71

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
Messages: 71



i see here again another code... and it has no path... what does this mean? :O

This message was edited 1 time. Last update was at by Jhedzkie Skies

 
jQuery in Action
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » JDBC
 
RSS feed
 
New topic
replay challenge