aspose file tools
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


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 2526
    
  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"
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: noob question about jdbc