Question: Getting error on my eclipse java connecting to mysql thru wampserver These are the errors I got back 1eimport java.sql.Connection; 2 import java.sql.DriverManager; 3 import
Getting error on my eclipse java connecting to mysql thru wampserver



These are the errors I got back

1eimport java.sql.Connection; 2 import java.sql.DriverManager; 3 import java.sql.SQLException; 4 import java.sql.Statement; 6 public class ConnectSql { 8 final static string url- "Jdbc : mysql://localhost : 3306/Javatest?autoRecconect-true&use>SL=false"; private static Connection con null; private static statement stmt null 10 12 13 public static void main(String[] args) 14 15 16 17 18 19e private static void createConnection() 20 21 createConnection) createTables(); insertInTables(); try Class.forName( "com.mysql.cj.jdbc.Driver"); // driver name con DriverManager.getConnection(uri, "root", ""); // location, user name and password 23 24 25 26 27 28 29 30 31 32 catch (ClassNotFoundException e) { System.err.println( "Error while loading The Driver"); e.printStackTrace(); catch (SQLException e) { System.err.println("Database Connection Failed"); e.printStackTrace(); private static void createTables() { 34 35 36 37 38 tr stmt- con.createStatement(); string tb = "Create Table Student(" +"NAME VARCHAR(50)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
