2.25学习总结

今天学习了“查”,查难度较大,学习了其中的一部分。

public String check(int m) throws Exception {
String a;
String sql = "SELECT * FROM daily where content like 'm'";


Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost:3306/abc";
String username = "root";
String Password = "123123";

Connection connection = DriverManager.getConnection(url, username, Password);
java.sql.Statement stmt = connection.createStatement();

java.sql.ResultSet rs = stmt.executeQuery(sql);

a = rs.getString(m);

stmt.close();
rs.close();

return a;

}

posted @ 2023-02-25 22:04  听着DJ读童话  阅读(15)  评论(0)    收藏  举报