Home > database >  Code without any problems but he gave me the wrong
Code without any problems but he gave me the wrong

Time:09-18

Package com. Alei. Mysql;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

Public class Demo {
Public static void main (String [] args) {
The Connection con=null;
The Statement STMT=null;
ResultSet rs=null;
Try {
Class.forName("com.mysql.jdbc.Driver");
Con=DriverManager. GetConnection (" JDBC: mysql://127.0.0.1:3306/student? ServerTimezone=UTC ", "root", "jiabeini");
System. The out. Println (con);

} the catch (a ClassNotFoundException e) {
//TODO Auto - generated the catch block,
e.printStackTrace();
} the catch (SQLException e) {
//TODO Auto - generated the catch block,
e.printStackTrace();
} the finally {
If (rs!=null) {
Try {
rs.close();
} the catch (SQLException e) {
//TODO Auto - generated the catch block,
e.printStackTrace();
}
}
If (STMT!=null) {
Try {
STMT. Close ();
} the catch (SQLException e) {
//TODO Auto - generated the catch block,
e.printStackTrace();
}
} the if (con!=null) {
Try {
con.close();
} the catch (SQLException e) {
//TODO Auto - generated the catch block,
e.printStackTrace();
}
}

}

}
}
Error: cannot find or unable to load the main class com. The mysql. Cj. JDBC. Admin. TimezoneDump
  • Related