⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usermanager.java

📁 基于MVC体系架构编写的login功能模块
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package Manager;import Com.JDBConnection;import java.sql.ResultSet;import java.sql.SQLException;/** * * @author XuLiYuan~11 */public class UserManager {        ResultSet rest = null;            public UserManager() {    }    public boolean islogin(String username, String password) {//        throw new UnsupportedOperationException("Not yet implemented");                boolean islogin = false;           JDBConnection jdbconnection = new JDBConnection();        jdbconnection.creatConnection();        try {//           String sql="select * from [user] where username like 'username' and password like 'password'";  String sql = "SELECT * FROM [user] WHERE username='";  sql = sql + username;  sql = sql + "'AND password='";  sql = sql + password;  sql = sql + "'";              rest=jdbconnection.executeQuery(sql);            if(rest.next()){                islogin=true;            }else{                islogin=false;            }        } catch (SQLException ex) {            ex.printStackTrace();        } finally{            jdbconnection.closeConnection();        }        return islogin;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -