public class SqlUtils {
/**
* @author liyinqiang01
* @description 根据用户名密码查询用户是否存在的方法
*/
public static boolean hasStudentsExist(String username,String passwd) throws ClassNotFoundException, SQLException {
// 驱动程序名
String driver = "com.mysql.jdbc.Driver";
// URL指向要访问的数据库名scutcs
String url = "jdbc:mysql://127.0.0.1:3306/jdbctest";
// MySQL配置时的用户名
String user = "root";
// MySQL配置时的密码
String password = "123456";
// 加载驱动程序
Class.forName(driver);
// 连续数据库
Connection conn = DriverManager.getConnection(url, user, password);
if (!conn.isClosed())
System.out.println("Succeeded connecting to the Database!");
// st
/**
* @author liyinqiang01
* @description 根据用户名密码查询用户是否存在的方法
*/
public static boolean hasStudentsExist(String username,String passwd) throws ClassNotFoundException, SQLException {
// 驱动程序名
String driver = "com.mysql.jdbc.Driver";
// URL指向要访问的数据库名scutcs
String url = "jdbc:mysql://127.0.0.1:3306/jdbctest";
// MySQL配置时的用户名
String user = "root";
// MySQL配置时的密码
String password = "123456";
// 加载驱动程序
Class.forName(driver);
// 连续数据库
Connection conn = DriverManager.getConnection(url, user, password);
if (!conn.isClosed())
System.out.println("Succeeded connecting to the Database!");
// st