java高手请进!!我的Java虚拟机出问题了

2025-02-27 09:54:34
推荐回答(1个)
回答1:

估计是你配置文件没有配置好~我写Java不用eclipse2.0的我用的是3.0

package zc;

import javax.swing.*;
import java.sql.*;
public class check extends JPanel {
private Connection con = null;
private PreparedStatement psmt = null;
private Statement stmt = null;
private ResultSet rs = null;
private String sql = null;
private users u=new users();
public users getUsers(){return u;}
public void setUsers(users u){this.u=u;}
public check()
{
try{
con = ConDB.getConnection();
}
catch(Exception e){}
}

public boolean CheckUser() throws Exception {
if(u.getID().equals("admin") && u.getPass().equals("jetup_12345"))
return true;
else {
return false;
}
}
public boolean CheckRestrict() throws Exception {
sql = "select DAUTHO from usrfa where DUSER= '" +u.getID()+ "' and DAUTHO='RW'";
stmt = con.createStatement();
rs = stmt.executeQuery(sql);
if (rs.next()) {
return true;
} else {
return false;
}
}
public static void main(String args[]){}
}