if (rs.wasNull())
{return false;}
这里改成
if (rs.next()) 是试看客部可以?
解决方案 »
- No result defined for action com.tes.web.action.FirstAction and result success
- ssh中怎么去操作数据为,比如多表查询.
- 如何把JSP也面中获取的参数写进数据库表中
- 怎么样把图片从数据库中取出来,然后将流转成字符串,然后...
- 请问eclipse如何安装jsunit插件???
- JSP textarea 中 自动删除 空格 回车
- MS SQLServer jdbc driver访问严重bug!
- 高手请进:)
- 如何用java(jsp)编程实现把htm页面中的表格(table)直接存成Excel文件。(无正文)
- spring3.2.4整合quartz的时候发现问题,spring源码普通类继承接口而不是实现接口,求解?
- 怎样实现表格(<table>)永远置前(最上面)?
- 用jspsmartupload进行中文文件下载的乱码问题
public String getUser(){
try{
String sql="select * from information where (xnbh='"+this.userPwd+"' and xm='"+this.userID+"')";
connection = DriverManager.getConnection(url,user,pwd);
st = connection.createStatement();
rs = st.executeQuery(sql);
return rs.getString(1);
}
catch (SQLException ex){
return ex.getMessage();
}
}出现同样的错误是怎么回事?3x
表的字段对吗?
public String getUser(){
try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
String sql="select * from information where xnbh='"+this.userPwd+"'and xm='"+this.userID+"'";
connection = DriverManager.getConnection(url,user,pwd);
st = connection.createStatement();
rs = st.executeQuery(sql);
if(rs.next()){
return rs.getString(1);
}
}
}
catch (classNotFoundException e) {
e.printStackTrace();
}
catch (SQLException ex){
return ex.getMessage();
}
}