Пример #1
0
 /**
  * Insert entity into the data base from the object oriented entity
  *
  * @param wrapperConnection wrapper connection from the connection pool
  * @param entity entity might be inserting into the data base
  * @throws SQLException
  */
 @Override
 protected void insertEntity(WrapperConnectionProxy wrapperConnection, DBEntity entity)
     throws SQLException {
   Admin admin = (Admin) entity;
   PreparedStatement ps = wrapperConnection.prepareStatement(SQL_FOR_ADMIN_INSERTING);
   ps.setString(1, admin.getFirstName());
   ps.setString(2, admin.getLastName());
   ps.setString(3, admin.getAdminType().toString());
   ps.setString(4, admin.getEmail());
   ps.setString(5, admin.getLogin());
   ps.setString(6, admin.getPassword());
   ps.executeUpdate();
 }