1 package org.lxh.demo17.statementdemo;
 2 
 3 import java.sql.Connection;
 4 import java.sql.DriverManager;
 5 import java.sql.SQLException;
 6 import java.sql.Statement;
 7 
 8 public class resetPassword {
 9     private static final String DBDRIVER = "com.mysql.jdbc.Driver";
10     private static final String DBURL = "jdbc:mysql://localhost:3306/mldn";
11     private static final String DBUSER = "root";
12     private static final String DBPASS = "root";
13     public static void main(String[] args) throws ClassNotFoundException, SQLException {
14         Connection conn = null;
15         Statement stmt = null;
16         String sql = "update emp set ename='jjjj' where empno=123";
17         System.out.println("wanchengSQLyuju");
18         Class.forName(DBDRIVER);
19         conn = DriverManager.getConnection(DBURL, DBUSER, DBPASS);
20         stmt = conn.createStatement();
21         stmt.executeUpdate(sql);
22         stmt.close();
23         conn.close();
24     }
25 
26 }

 

相关文章:

  • 2022-12-23
  • 2021-08-15
  • 2021-07-29
  • 2021-12-08
  • 2021-11-18
  • 2021-11-28
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2021-12-26
  • 2021-11-26
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
相关资源
相似解决方案