-1
即时尝试连接到mysql数据库并操纵其中的数据,但是当我尝试运行我的代码时,它得到错误,驱动程序[java应用程序] C:\ program files \ java \ jre 1.8 .0_111 \ bin \ javaw.exe从什么我一直在阅读它,因为它启动javaw而不是java.exe,但我似乎无法弄清楚如何切换到该任何人都可以帮助我?运行eclipse时终止javaw错误
package jdbc;
import java.sql.*;
public class Driver {
public static void main(String[] args) {
try
{
//get a connection to the database
Connection myConn = DriverManager.getConnection("jdbc:mysql://localhost:3306/cs160test");
//create a statement
Statement myStmt = myConn.createStatement();
//execute the sql query
ResultSet myRs = myStmt.executeQuery("select * from genre");
//process the result set
while(myRs.next())
{
System.out.println(myRs.getString("name"));
}
}
catch(Exception exc)
{
exc.printStackTrace();
}
}
}