I've been receiving this runtime error in netbeans. I even added the required jar file in Tools> Libraries but still recieving same error. I am lost. Please help me out.
Code:
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306//cart","student","student");
Statement st = con.createStatement();
ResultSet rs= st.executeQuery("select * from items");
rs.next();
String item =rs.getString("itemname");
System.out.println(item);
Code error:
Location of the jar file:
Can you try one slash before cart
"jdbc:mysql://localhost:3306/cart"
? Please copy code, don't use screenshot for code. https://stackoverflow.com/help/how-to-ask.And use markdow https://stackoverflow.com/editing-help