Two Laptop Bag
The moose likes JDBC and Relational Databases and the fly likes noob question about jdbc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "noob question about jdbc" Watch "noob question about jdbc" New topic

noob question about jdbc

arnie frenato

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

Joined: Dec 20, 2006
Posts: 2565

You have to import these classes.

Can you show us your import statements in

Regards, Jan

OCUP UML fundamental and ITIL foundation
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:
subject: noob question about jdbc
It's not a secret anymore!