Hallo Thorsten... I tried to imported "java.lang.*" but it didn't work. Still the same error message. Here is the error message : " ifirdaus@susefujitsu:~/arsip/proyek> javac LoadDriver.java LoadDriver.java:30: cannot resolve symbol symbol : class Statement location: class LoadDriver Statement stmt = null; ^ LoadDriver.java:31: cannot resolve symbol symbol : class ResultSet location: class LoadDriver ResultSet rs = null; ^ 2 errors ifirdaus@susefujitsu:~/arsip/proyek> " Here is my code: " import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.lang.*; // Notice, do not import com.mysql.jdbc.* // or you will have problems! public class LoadDriver { public static void main(String[] args) { try { // The newInstance() call is a work around for some // broken Java implementations Class.forName("com.mysql.jdbc.Driver").newInstance(); System.out.println("The driver was loaded succesfully."); } catch (Exception ex) { // handle the error System.out.println("The driver could not be loaded."); } try { Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/amt?user=root&password=prabumas"); // Do something with the Connection System.out.println("Connection has been built"); // Doing select Query // assume conn is an already created JDBC connection Statement stmt = null; ResultSet rs = null; " Please teach me... Where the mistake. --- Thorsten Haude <linux@thorstenhau.de> wrote:
Hi,
* Prabu Subroto <prabu_subroto@yahoo.com> [2003-07-08 22:21]:
psubroto@susefujitsu:~/arsip/proyek> javac LoadDriver.java LoadDriver.java:29: cannot resolve symbol symbol : class Statement location: class LoadDriver Statement stmt = null; ^ LoadDriver.java:30: cannot resolve symbol symbol : class ResultSet location: class LoadDriver ResultSet rs = null; ^ 2 errors psubroto@susefujitsu:~/arsip/proyek>
And this is my code: ==== import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; (...)
I'm too lazy to look it up, but I doubt that Statement or ResultSet are in java.lang. You must import them.
Thorsten -- When bad men combine, the good must associate; else they will fall one by one, an unpitied sacrifice in a contemptible struggle. - Edmund Burke
ATTACHMENT part 2 application/pgp-signature
__________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com