菜问题:关于编译这个javabean 的问题
UserLogOn.java 文件代码如下:
package com.jb.logon;
import java.sql.*;
public class UserLogOn {
private String username;
private String userpassword;
private ResultSet rs;
private DB db=new DB();
public UserLogOn(){}
public void setUsername(String username){
this.username=username;
}
public String getUsername(){
return this.username;
}
public void setUserpassword(String userpassword){
this.userpassword=userpassword;
}
public String getUserpassword(){
return this.userpassword;
}
public String checkuser(){
String backstr= " ";
boolean mark=true;
if(this.username==null||this.username.equals( " ")){
backstr+= " <li> 请输入 <b> 用户名! </b> </li> <br> ";
mark=false;
}
if(this.userpassword==null||this.userpassword.equals( " ")){
backstr+= " <li> 请输入 <b> 密 码! </b> </li> <br> ";
mark=false;
}
if(mark){
String sql= "select * from tb_logon where user_name= ' "+this.username+ " ' and user_password= ' "+this.userpassword+ " ' ";
try{
rs=db.getRs(sql);
if(!rs.next())
backstr= "登录失败! <br> 输入的 <b> 用户名 </b> 或 <b> 密码 </b> 不存在! ";
else
backstr= "登录成功! <br> <table> <tr> <td> 用户名: </td> <td> "+this.username+ " </td> </tr> <tr> <td> 密 码: </td> <td> "+this.userpassword+ " </td> </tr> </table> ";
}catch(Exception e){e.printStackTrace();}
}
db.closed();
return backstr;
}
}
--------------------
编译的时候出现这样的出错提示:
UserLogOn.java:8:cannot resolve symbol
symbol:class DB
location:class com.jb.logon.UserLogOn
private DB db=new DB();
我是不是没有引用 DB这个类呢?
望各位替小的指点下!
[解决办法]
很显然
[解决办法]
import 那个包就可以了