• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

VERY basic question about MySQL database access from Java

 
Janeice DelVecchio
Saloon Keeper
Posts: 1809
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a database using mySQL.

How do I access/manipulate that database from my Java application? The instructions for my project suggest using NetBeans, but I'm not keen on installing an IDE just for one project if there's another way (I'd also like to learn the right way.... I'm sure not everyone who uses databases with Java installs NetBeans...).

If someone could point out where to start......

 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Janeice,

Nope, you don't need NetBeans -- not even sure why someone would suggest that. You need to use the JDBC API, which is part of the standard JDK; it's the java.sql package. The API is the same for every database, but you need a "driver" -- a special JAR file -- for whatever database product you're using.

You can get the MySQL JDBC driver here. Here is the Java Tutorials section on JDBC, which is a decent introduction.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49796
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most things appear somewhere in the Java Tutorials and this is no exception
 
Campbell Ritchie
Sheriff
Pie
Posts: 49796
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Damn! EFH beat me to it by two minutes.

And I think this thread would sit better on our databases forum. Moving.
 
Janeice DelVecchio
Saloon Keeper
Posts: 1809
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot!

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic