原生方式
public static void main(String[] args) throws Exception{
jdbc();
}
public static void jdbc() throws Exception {
final String DRIVER = "com.mysql.cj.jdbc.Driver";
final String URL = "jdbc:mysql://localhost:3306/myjdbctest?serverTimezone=CST";
final String USER = "root";
final String PASS = "w1234";
String sql = "select username,password from user";
Connection connection = null;
PreparedStatement preparedStatement = null;
ResultSet result=null;
try {
Class.forName(DRIVER);
connection = DriverManager.getConnection(URL, USER, PASS);
preparedStatement = connection.prepareStatement(sql);
result &#