我写个javabean为什么报错呢!!郁闷啊!!
///////////////////////////////////////////////////////////////////////
package reg;
import java.sql.*;
public class RegisterBean {
private String username;
private String pwd;
private String uid;
public void setUsername(String username){
this.username=username;
}
public void setPwd(String pwd){
this.pwd=pwd;
}
public void setUid(String uid){
this.uid=uid;
}
public String getUsername(){
return username;
}
public String getPwd(){
return pwd;
}
public String getUid(){
return uid;
}
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:logistics";
Connection conn = DriverManager.getConnection(url, "admin3","admin3");
}catch(SQLException e){
e.printStackTrace();
}
}
///////////////////////////////////////////////////////////////////////