private void executePreparedStatement(String sql,Object... arguments) throws SQLException {
  Connection connection=null;
  PreparedStatement preparedStatement=null;
  try {
    DataSource dataSource=DaoSpringModuleConfig.getHerdDataSource();
    connection=dataSource.getConnection();
    preparedStatement=connection.prepareStatement(sql);
    for (int i=0; i < arguments.length; i++) {
      preparedStatement.setObject(i + 1,arguments[i]);
    }
    preparedStatement.execute();
  }
  finally {
    if (preparedStatement != null) {
      preparedStatement.close();
    }
    if (connection != null) {
      connection.close();
    }
  }
}

private void executePreparedStatement ( String sql , Object ... arguments ) throws SQLException { Connection connection = null ; PreparedStatement preparedStatement = null ; try { DataSource dataSource = DaoSpringModuleConfig . getHerdDataSource ( ) ; connection = dataSource . getConnection ( ) ; preparedStatement = connection . prepareStatement ( sql ) ; for ( int i = 0 ; i < arguments . length ; i ++ ) { preparedStatement . setObject ( i + 1 , arguments [ i ] ) ; } preparedStatement . execute ( ) ; } finally { if ( preparedStatement != null ) { preparedStatement . close ( ) ; } if ( connection != null ) { connection . close ( ) ; } } }
executes a sql prepared statement with the specified arguments .
