谁来帮忙看看这个javabean我那里写错了
请帮忙看一看那里写错了package com.bean;
import java.sql.*;
public class loginjdbc{
private Connection conn=null;
private Statement st=null;
private ResultSet rt=null;
private newuser user;
boolean cc;
public loginjdbc(){
final String forname="com.microsoft.jdbc.sqlserver.SQLServerDriver";
final String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=luntan";
final String user="sa";
final String pwd="sa";
try{
Class.forName(forname);
conn=DriverManager.getConnection(url,user,pwd);
}catch(Exception e){
e.printStackTrace();
}
}
public void setUser(newuser c){
user=c;
}
public boolean getUser(){
try{
st=conn.createStatement();
String username=user.getUsername();
String password=user.getPassworda();
String sql="select * from newuser where Name='"+username+"' and Pwd '"+password+"'";
rt=st.executeQuery(sql);
if(rt.next()){
cc=true;
}
}catch(Exception e){
e.printStackTrace();
}
return cc;
}
}
页面部分
<%@ page c language="java" import="java.sql.*"%>
<jsp:useBean id="user" scope="request" class="com.bean.newuser">
<jsp:setProperty name="user" property="*"/>
</jsp:useBean>
<jsp:useBean id="login" scope="request" class="com.bean.loginjdbc"/>
<%
String username=request.getParameter("username");
String passworda=request.getParameter("passworda");
if(!username.equals("") && username!=null && !passworda.equals("") && passworda!=null){
login.setUser(user);
if(login.getUser()==true){
out.print("111");
}else{
out.print("222");
}}
%>