String sqlString2=null;
sqlString2=new String( "SELECT * FROM [user] where UserID= 'liu6787494 ' ");
Connection con;
Statement sql;
ResultSet rs;
try
{
Class.forName( "com.microsoft.jdbc.sqlserver.SQLServerDriver ");
}
catch(ClassNotFoundException e)
{
out.print( "类找不到! ");
}
try
{
con=DriverManager.getConnection( "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=sdfasdf ", "sa ", "werqwerqwer ");
sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
rs=sql.executeQuery(sqlString2);
rs.last();
rs.beforeFirst();
while(rs.next())
{
out.print(rs.getString( "UserID "));
out.print(rs.getString( "Password "));
out.print(rs.getString( "bpassword "));
out.print(rs.getString( "question "));
out.print(rs.getString( "answer "));
out.print(rs.getString( "email "));
out.print(rs.getString( "IDE "));
out.print(rs.getString( "username "));
}
con.close();
}
catch(SQLException e1)
{
out.print( "SQL异常! ");
}
怎么把rs.getString( "UserID "),out.print(rs.getString( "Password ")),out.print(rs.getString( "bpassword ")),out.print(rs.getString( "question ")),out.print(rs.getString( "answer ")),out.print(rs.getString( "email ")),out.print(rs.getString( "IDE ")),out.print(rs.getString( "username "))这的值附到一个变量上去``我在try里面附值到try再调用变量就会报错了````
------解决方案--------------------