im trying to connect to mysql database and manipulate the data in it but when i try to run my code it get the error, driver [java application] C:\program files\java\jre 1.8.0_111\bin\javaw.exe from what ive been reading its because its launching javaw and not java.exe but i cant seem to figure out how to switch to that can anyone help me?
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();
}
}
}
That is no error. It is telling you that your program
exitedbecause there wasn't further instructions to follow.I reproduced this behavior and the only way this is happening is if your
genretable has no records.