我必须更新我的两列表
import java.sql.*;
import javax.sql.*;
public class User {
public static void main(String args[]) {
String id = "QZhx_w1eEJ";
String created = "true";
String vmname = "pratap";
String dbUrl = "jdbc:mysql://localhost:3306/test";
String dbClass = "com.mysql.jdbc.Driver";
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection(dbUrl);
Statement stmt = con.createStatement();
stmt.executeUpdate("update userprofil set created='" + created
+ "',vmname='" + vmname + "' where userprofil.id= '" + id
+ "'");
con.close();
} // end try
catch (ClassNotFoundException e) {
e.printStackTrace();
}
catch (SQLException e) {
e.printStackTrace();
}
} // end main
} // end class
这是错误日志
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at User.main(User.java:17)
任何人都可以帮助我..
谢谢..