Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about odbc connection

 
Aron Jhed Amiscosa
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Aron Jhed Amiscosa
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Aron Jhed Amiscosa
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


i see here again another code... and it has no path... what does this mean? :O
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic