为了账号安全,请及时绑定邮箱和手机立即绑定

如下所示,页面显示:服务器遇到一个内部错误 (), 无法完成此请求?

如下所示,页面显示:服务器遇到一个内部错误 (), 无法完成此请求?

蛊毒传说 2023-01-12 19:15:39
public void insertNewCurrency_Rate(Rate_setInfo info)throws RemoteException{  Connection con = null;PreparedStatement ps = null;StringBuffer strBuff = new StringBuffer();//try{con = Database.getConnection();//启动数据库 //下一行链接数据库表String control=" insert into currency_set(tseffectivedate,sbasecurrency,scurrencyunit,sinputusername,tsinputdate,lcurrencyrate,scurrency)values('"+info.getTsEffectiveDate()+"','"+info.getSBaseCurrency()+"','"+info.getSCurrencyUnit()+"','"+info.getSInputUsername()+"','"+info.getTsInputDate()+"','"+info.getLCurrencyRate()+"','"+info.getSCurrency()+"'";ps = con.prepareStatement(control.toString());ps.executeUpdate();//关闭资源ps.close();ps = null;con.close();con = null;}catch (Exception e){e.printStackTrace();throw new RemoteException(e.getMessage());}finally{try{if (ps != null)ps.close();if (con != null)con.close();}catch (Exception ex){throw new RemoteException(ex.getMessage());}}}
查看完整描述

1 回答

?
陪伴而非守候

TA贡献1757条经验 获得超8个赞

将“//关闭资源
ps.close();
ps = null;
con.close();
con=null;“ 去掉
finally里,ps和con各使用一个try与catch,不要搞到一起。

查看完整回答
反对 回复 2023-01-15
  • 1 回答
  • 0 关注
  • 75 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信