小女初学者,各位大神帮忙啊!环境为Netbeans IDE 6.8代码如下:
private boolean valid(HttpServletRequest request, LoginActionForm loginActionForm) {
DataSource ds = null;
Connection cn = null;
boolean b = false;
try {
ds = getDataSource(request) ;//此处getDataSource()下有红线,标识找不到符号
cn = ds.getConnection();
Statement st = cn.createStatement();
ResultSet rs = st.executeQuery("select * from user where username='" + loginActionForm.getUsername()
+ "' and password='" + loginActionForm.getPassword() + "'");
if (rs.next()) {
b = true;
}
rs.close();
st.close();
cn.close();
} catch (Exception e) {
e.printStackTrace();
}
return b;
}
private boolean valid(HttpServletRequest request, LoginActionForm loginActionForm) {
DataSource ds = null;
Connection cn = null;
boolean b = false;
try {
ds = getDataSource(request) ;//此处getDataSource()下有红线,标识找不到符号
cn = ds.getConnection();
Statement st = cn.createStatement();
ResultSet rs = st.executeQuery("select * from user where username='" + loginActionForm.getUsername()
+ "' and password='" + loginActionForm.getPassword() + "'");
if (rs.next()) {
b = true;
}
rs.close();
st.close();
cn.close();
} catch (Exception e) {
e.printStackTrace();
}
return b;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货