一个JSP连接mysql错误!
一直提示com.mysql软件包不存在!
代码如下:
import untitled2.UseExecute;
import java.sql.*;
public class UseExecute {
public static void main(String[] args) {
String url = "jdbc:mysql://localhost/sql.test ";
String useName = "root ";
String password = "root ";
String sql = " ";
Connection conn = null;
Statement stmt = null;
if (args.length == 0) {
System.out.println( "您没有办入SQL语句 ");
return;
}
for (int i = 0; i < args.length; i++) {
sql = sql + args[i] + " ";
}
try {
Class.forName(com.mysql.jdbc.driver);
} catch (
ClassNotFoundException ex) {
System.out.println( "出错 ");
}
try {
conn = DriverManager.getConnection(url,useName,password);
stmt = conn.createStatement();
System.out.println( " ");
System.out.println( "执行SQL语句 " + sql);
boolean isResultSet = stmt.execute(sql);
int count = 0;
while (true) {
count++;
&nb