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());
}
}
}
陪伴而非守候
相关分类