String sel="select count(*) from guanyuanbiao where guoji='" + guoji + "' and zhiwei='01'";
rs=stmt.executeQuery(sel);
int ok=0;
if(!rs.next()){
ok = getInt(1);
}
if (ok > 0 ) {
wzg="insert into guanyuanbiao...
}
rs=stmt.executeQuery(sel);
int ok=0;
if(!rs.next()){
ok = getInt(1);
}
if (ok > 0 ) {
wzg="insert into guanyuanbiao...
}
……
Generated servlet error:
D:\java\tomcat\work\Standalone\localhost\_\lingshi\addokguanyuan$jsp.java:165: Method getInt(int) not found in class org.apache.jsp.addokguanyuan$jsp.
ok = getInt(1);
^
Note: D:\java\tomcat\work\Standalone\localhost\_\lingshi\addokguanyuan$jsp.java uses or overrides a deprecated API. Recompile with "-deprecation" for details.
1 error, 1 warning
rs=stmt.executeQuery(sel);
int ok=0;
while(rs.next()){
ok = rs.getInt(1);
}sel = "insert into guanyuanbiao..."
if (ok > 0 ) {
stmt.executeUpdate(sel);
}