예제 #1
0
 /** Update the characters table of the database with power grade. */
 public void updatePowerGrade() {
   ThreadConnection con = null;
   FiltredPreparedStatement statement = null;
   try {
     con = L2DatabaseFactory.getInstance().getConnection();
     statement = con.prepareStatement(Characters.UPDATE_CHAR_POWER_GRADE);
     statement.setLong(1, _powerGrade);
     statement.setInt(2, getObjectId());
     statement.execute();
   } catch (Exception e) {
     _log.log(Level.ERROR, "Could not update power _grade: " + e.getMessage(), e);
   } finally {
     DatabaseUtils.closeDatabaseCS(con, statement);
   }
 }
예제 #2
0
 public void saveApprenticeAndSponsor(int apprentice, int sponsor) {
   ThreadConnection con = null;
   FiltredPreparedStatement statement = null;
   try {
     con = L2DatabaseFactory.getInstance().getConnection();
     statement = con.prepareStatement(Characters.UPDATE_CHAR_APPRENTICE_SPONSOR);
     statement.setInt(1, apprentice);
     statement.setInt(2, sponsor);
     statement.setInt(3, getObjectId());
     statement.execute();
   } catch (SQLException e) {
     _log.log(Level.ERROR, "Could not save apprentice/sponsor: " + e.getMessage(), e);
   } finally {
     DatabaseUtils.closeDatabaseCS(con, statement);
   }
 }