aspose file tools*
The moose likes JDBC and the fly likes VERY basic question about MySQL database access from Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "VERY basic question about MySQL database access from Java" Watch "VERY basic question about MySQL database access from Java" New topic
Author

VERY basic question about MySQL database access from Java

Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1614
    
  10

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


When you do things right, people won't be sure you've done anything at all.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

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.


[Jess in Action][AskingGoodQuestions]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36514
    
  16
Most things appear somewhere in the Java Tutorials and this is no exception
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36514
    
  16
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

Joined: Sep 14, 2009
Posts: 1614
    
  10

Thanks a lot!

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: VERY basic question about MySQL database access from Java
 
Similar Threads
can't access database
How to send a J2EE web application linked to mysql database to others?
NetBeans IDE 5.0 = how to connect my database
Netbeans classpath problem
Eclipse (Mac): Access restriction: The constructor Driver() is not accessible due to restriction...