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

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());
}
}
}

蛊毒传说
浏览 79回答 1
1回答

陪伴而非守候

将“//关闭资源ps.close();ps = null;con.close();con=null;“ 去掉finally里,ps和con各使用一个try与catch,不要搞到一起。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript