Web服务错误删除
Webservice error delete
您好,我正在尝试 运行 我的网络服务中的查询,但是查询所在的函数从无到有中断。
我的代码:
public boolean excluir(String usuario)
{
String sql = "DELETE * FROM listaproduto where uclogin=?";
Boolean retorno = false;
PreparedStatement pst = Conexao.getPreparedStatement(sql);
try {
pst.setString(1, usuario); //He breaks that part.
if(pst.executeUpdate()>0)
{
retorno = true;
}
} catch (SQLException ex) {
Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);
retorno = false;
}
return retorno;
}
错误:
GET SolicitaçãoFailed RequestFailed --> Status: (500) Resposta: { HTTP Status 500 - Internal Server Error
type Exception report
messageInternal Server Error
descriptionThe server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.NullPointerException
root cause
java.lang.NullPointerException
注意 GlassFish Server Open Source Edition 4.1.1 日志中提供了异常的完整堆栈跟踪及其根本原因。 GlassFish Server 开源版 4.1.1
String sql = "DELETE FROM listaproduto where uclogin=?";
删除你的''然后再试一次..我认为删除方法不需要''..
希望这可以帮助你:)
您好,我正在尝试 运行 我的网络服务中的查询,但是查询所在的函数从无到有中断。
我的代码:
public boolean excluir(String usuario)
{
String sql = "DELETE * FROM listaproduto where uclogin=?";
Boolean retorno = false;
PreparedStatement pst = Conexao.getPreparedStatement(sql);
try {
pst.setString(1, usuario); //He breaks that part.
if(pst.executeUpdate()>0)
{
retorno = true;
}
} catch (SQLException ex) {
Logger.getLogger(ProdutoDAO.class.getName()).log(Level.SEVERE, null, ex);
retorno = false;
}
return retorno;
}
错误:
GET SolicitaçãoFailed RequestFailed --> Status: (500) Resposta: { HTTP Status 500 - Internal Server Error
type Exception report
messageInternal Server Error
descriptionThe server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.NullPointerException
root cause
java.lang.NullPointerException
注意 GlassFish Server Open Source Edition 4.1.1 日志中提供了异常的完整堆栈跟踪及其根本原因。 GlassFish Server 开源版 4.1.1
String sql = "DELETE FROM listaproduto where uclogin=?";
删除你的''然后再试一次..我认为删除方法不需要''.. 希望这可以帮助你:)