Code example for Connection

Methods: prepareStatement

0
  public final void storeMapping(long longID, String stringID) throws TasteException {
    Connection conn = null;
    PreparedStatement stmt = null;
    try { 
      conn = dataSource.getConnection();
      stmt = conn.prepareStatement(storeMappingSQL);
      stmt.setLong(1, longID);
      stmt.setString(2, stringID);
      stmt.executeUpdate();
    } catch (SQLException sqle) {
      throw new TasteException(sqle);
    } finally { 
      IOUtils.quietClose(null, stmt, conn);
    } 
  } 
   
  @Override 
  public final String toStringID(long longID) throws TasteException {
    Connection conn = null;
    PreparedStatement stmt = null;