📄 logincheck.java
字号:
import java.sql.*;
public class LoginCheck{
Connection con = null;
Statement stmt = null;
ResultSet loginRs = null;
public void InitCheck( Connection con )
{
if ( this.con != con )
{
this.con = con;
}
try
{
stmt = con.createStatement();
String strSQL = "select * from operator";
loginRs = stmt.executeQuery( strSQL );
}
catch ( SQLException sex )
{
System.out.println( sex.toString() );
}
}
public boolean next()
{
boolean result = false;
try
{
result = loginRs.next();
}
catch ( SQLException sex )
{
System.out.println( sex.toString() );
}
return result;
}
public String getName(){
String result = null;
try{
result = loginRs.getString("name");
}catch(SQLException id){
System.out.println( id.toString() );
}
return result;
}
public String getPassWord(){
String result = null;
try{
result = loginRs.getString("password");
}catch(SQLException id){
System.out.println( id.toString() );
}
return result;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -