import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class T_UsersTest {
static Scanner s=new Scanner(System.in);
static Connection conn=getConn();
public static void main(String[] args) {
logIn();//登录之后才具有操作权限
try {
conn.close();//关闭Connection
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
s.close();
}
/**
* 获得Connection
* @return
*/
public static Connection getConn() {
try {
//加载驱动
Class.forName("com.mysql.jdbc.Driver");
//获得连接
String url="jdbc:mysql://localhost:3306/java1710";
String name="root";
String password="0325";
Connection conn=DriverManager.getConnection(url,name,password);
return conn;
} catch (Excep
jdbc进行用户信息管理
最新推荐文章于 2023-06-27 14:08:39 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)