This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes JDBC and the fly likes noob question about jdbc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "noob question about jdbc" Watch "noob question about jdbc" New topic
Author

noob question about jdbc

arnie frenato
Greenhorn

Joined: Mar 08, 2007
Posts: 14
I tried installing the mysql-connector-java-3.0.17.
I copied the mysql-connector-java-3.0.17-ga-bin.jar to the javadir\jre\lib\ext (like it said in the documentation) and tried this code:


after compiling, the errors were that it didn't recognize the Statement, Conenction, and DriverManager Objects. Is there a problem with the code or in the installation?

I'm looking forward to hearing from you guys soon.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

You have to import these classes.

Can you show us your import statements in Jdbc11.java?

Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
Rao Raghu
Ranch Hand

Joined: Jan 05, 2007
Posts: 100
Import the following:



String url = "jdbc:mysql://localhost:3306/mysql";


Are you sure the name of your database is 'mysql'? In the subsequent code you are also creating a database:

stmt.executeUpdate("CREATE DATABASE JunkDB");


RAGHU<br /> <br />"When the going gets tough, the tough get going"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: noob question about jdbc