jQuery in Action, 2nd edition*
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 Android Security Essentials Live Lessons this week in the Android 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: 2491
    
    8

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
 
Similar Threads
eclipse can not connect to mysql!!!
Visibility help?
com.mysql.jdbc.NotUpdatable: Result Set not updatable
Assistance Needed Setting up First JDBC Program
Cannot find symbol