• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Database

 
Ranch Hand
Posts: 282
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do I hook up my program to a database, say a MS Access database for example. I NetBeans that is. I went through the steps on Help and it cannot find my database. Im supposed to type in the database name where there's <DB> and I do, but it cannot find it. I tried typing in the entire path, tried putting the DB inside the folder with the project and just specifying the name, and tried putting it in quotes, I tried putting it in < > these and still does not work. I have the JDBC-ODBC-Bridge driver and that's it. Do I need another to connect to Access?

the steps Netbean help gave me was under the runtime pane choose Database, Drivers, then right click on the correct driver and choose connect using and specify the URL where the database is. My database is not on a URL, its on my computer.
 
Saloon Keeper
Posts: 25649
183
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, first off, is this a standalone Java app or a web app? Not that it really matters, since if you use JDBC to access data, either way you need a URL, but MS-Access and the JDBC-ODBC bridge are not suitable for multi-user applications such as web apps.

You should be able to use a URL that looks something like this:

jdbc dbc river={Microsoft Access Driver (*.mdb)};DBQ=C:/data/mydatabase.MDB
 
Tim Holloway
Saloon Keeper
Posts: 25649
183
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whoops. The "smilies" ate my URL!

jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/data/mydatabase.MDB
 
James Hambrick
Ranch Hand
Posts: 282
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am just using acces to start with, to get used to dealing with databases in Java. I am database analyst over a Oracle database so I can eventually create my own database and tables on there to play with I hope.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic