-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();
}
}
}