jdbc(1)

it2023-03-18  75

Class.forName(“com.mysql.cj.jdbc.Driver”); Connection conn = DriverManager.getConnection(“jdbc:mysql://localhost:3306/stu ?serverTimezone=UTC”, “root”, “123456”); String sql=“update account set balance = 500 where id = 1”; Statement stmt = conn.createStatement(); int count = stmt.executeUpdate(sql); System.out.println(count); stmt.close(); conn.close(); 和inset undate ResultSet的联系

最新回复(0)