JAVA和SQl
stmt.close();conn.close();response.sendRedirect(response.encodeURL("ROOT/login.jsp"))...
stmt.close();
conn.close();
response.sendRedirect(response.encodeURL("ROOT/login.jsp"));
}
}
}catch(SQLException ex){
out.println(ex.getMessage());
out.println(ex.getSQLState());
out.println(ex.getErrorCode());
ex=ex.getNextException();
}
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\t</body>\r\n");
out.write("</html>");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
//有错误信息:
jjj.java:78: ')' expected
stmt.executeUpdate(INSERT INTO TABLE2 VALUES('_u
sername','_password';));
^
jjj.java:78: unclosed character literal
stmt.executeUpdate(INSERT INTO TABLE2 VALUES('_u
sername','_password';));
^
jjj.java:78: unclosed character literal
stmt.executeUpdate(INSERT INTO TABLE2 VALUES('_u
sername','_password';));
^
jjj.java:8: class login_jsp is public, should be declared in a file named login_
jsp.java
public final class login_jsp extends org.apache.jasper.runtime.HttpJspBase
^
jjj.java:8: package org.apache.jasper.runtime does not exist
public final class login_jsp extends org.apache.jasper.runtime.HttpJspBase
^
jjj.java:9: package org.apache.jasper.runtime does not exist
implements org.apache.jasper.runtime.JspSourceDependent {
^
jjj.java:56: cannot resolve symbol
symbol : variable _e_mail
location: class org.apache.jsp.login_jsp
if(_e_mail.equals("")){
^
jjj.java:57: cannot resolve symbol
symbol : variable _e_mail
location: class org.apache.jsp.login_jsp
_e_mail="no email address";
^
jjj.java:78: cannot resolve symbol
symbol : variable INSERT
location: class org.apache.jsp.login_jsp
stmt.executeUpdate(INSERT INTO TABLE2 VALUES('_u
sername','_password';));
^
Note: jjj.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
9 errors 展开
conn.close();
response.sendRedirect(response.encodeURL("ROOT/login.jsp"));
}
}
}catch(SQLException ex){
out.println(ex.getMessage());
out.println(ex.getSQLState());
out.println(ex.getErrorCode());
ex=ex.getNextException();
}
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\t</body>\r\n");
out.write("</html>");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
//有错误信息:
jjj.java:78: ')' expected
stmt.executeUpdate(INSERT INTO TABLE2 VALUES('_u
sername','_password';));
^
jjj.java:78: unclosed character literal
stmt.executeUpdate(INSERT INTO TABLE2 VALUES('_u
sername','_password';));
^
jjj.java:78: unclosed character literal
stmt.executeUpdate(INSERT INTO TABLE2 VALUES('_u
sername','_password';));
^
jjj.java:8: class login_jsp is public, should be declared in a file named login_
jsp.java
public final class login_jsp extends org.apache.jasper.runtime.HttpJspBase
^
jjj.java:8: package org.apache.jasper.runtime does not exist
public final class login_jsp extends org.apache.jasper.runtime.HttpJspBase
^
jjj.java:9: package org.apache.jasper.runtime does not exist
implements org.apache.jasper.runtime.JspSourceDependent {
^
jjj.java:56: cannot resolve symbol
symbol : variable _e_mail
location: class org.apache.jsp.login_jsp
if(_e_mail.equals("")){
^
jjj.java:57: cannot resolve symbol
symbol : variable _e_mail
location: class org.apache.jsp.login_jsp
_e_mail="no email address";
^
jjj.java:78: cannot resolve symbol
symbol : variable INSERT
location: class org.apache.jsp.login_jsp
stmt.executeUpdate(INSERT INTO TABLE2 VALUES('_u
sername','_password';));
^
Note: jjj.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
9 errors 展开
1个回答
展开全部
描述的不清楚
stmt.executeUpdate(INSERT INTO TABLE2 VALUES('_u
sername','_password';));
改为
stmt.executeUpdate("INSERT INTO TABLE2 VALUES('_u
sername','_password')");
如果_username和_password是变量就还要改一下
stmt.executeUpdate("INSERT INTO TABLE2 VALUES('"+_u
sername+"','"+_password+"')");
stmt.executeUpdate(INSERT INTO TABLE2 VALUES('_u
sername','_password';));
改为
stmt.executeUpdate("INSERT INTO TABLE2 VALUES('_u
sername','_password')");
如果_username和_password是变量就还要改一下
stmt.executeUpdate("INSERT INTO TABLE2 VALUES('"+_u
sername+"','"+_password+"')");
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询