File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

noob question about jdbc

 
arnie frenato
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2577
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to import these classes.

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

Regards, Jan
 
Rao Raghu
Ranch Hand
Posts: 100
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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");
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic