Package org.milowski.db

Examples of org.milowski.db.DBConnection.update()


   public void addRole(final Role role)
      throws SQLException
   {
      DBConnection connection = db.getConnection();
      try {
         connection.update(AuthDB.DELETE_USER_ROLE, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,id);
               s.setInt(2,role.getId());
View Full Code Here


            {
               s.setInt(1,id);
               s.setInt(2,role.getId());
            }
         });
         connection.update(AuthDB.ADD_USER_ROLE, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,id);
               s.setInt(2,role.getId());
View Full Code Here

   public boolean removeRole(final Role role)
      throws SQLException
   {
      DBConnection connection = db.getConnection();
      try {
         return connection.update(AuthDB.USER_HAS_ROLE, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,id);
               s.setInt(2,role.getId());
View Full Code Here

      throws SQLException
   {
      if (alias==null && this.alias!=null) {
         DBConnection connection = db.getConnection();
         try {
            connection.update(AuthDB.DELETE_USER_ALIAS, new DBUpdateHandler() {
               public void prepare(PreparedStatement s)
                  throws SQLException
               {
                  s.setInt(1,id);
               }
View Full Code Here

      }
      if (this.alias!=null) {
         db.userCache.removeByName(this.alias);
         DBConnection connection = db.getConnection();
         try {
            connection.update(AuthDB.CHANGE_USER_ALIAS, new DBUpdateHandler() {
               public void prepare(PreparedStatement s)
                  throws SQLException
               {
                  s.setString(1,alias);
                  s.setString(2,id+"-"+alias);
View Full Code Here

            db.release(connection);
         }
      } else {
         DBConnection connection = db.getConnection();
         try {
            connection.update(AuthDB.CREATE_USER_ALIAS, new DBUpdateHandler() {
               public void prepare(PreparedStatement s)
                  throws SQLException
               {
                  s.setInt(1,id);
                  s.setString(2,alias);
View Full Code Here

   public void setName(final String name)
      throws SQLException
   {
      DBConnection connection = db.getConnection();
      try {
         connection.update(AuthDB.CHANGE_USER_NAME, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               if (name==null) {
                  s.setNull(1,Types.VARCHAR);
View Full Code Here

   public void setEmail(final String email)
      throws SQLException
   {
      DBConnection connection = db.getConnection();
      try {
         connection.update(AuthDB.CHANGE_USER_NAME, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               if (email==null) {
                  s.setNull(1,Types.VARCHAR);
View Full Code Here

      if (session!=null) {
         // delete any session authentication information first
         if (realm==null) {
            DBConnection connection = db.getConnection();
            try {
               connection.update(AuthDB.DELETE_USER_AUTHENTICATION, new DBUpdateHandler() {
                  public void prepare(PreparedStatement s)
                     throws SQLException
                  {
                     s.setInt(1,id);
                     s.setString(2,session.toString());
View Full Code Here

               db.release(connection);
            }
         } else {
            DBConnection connection = db.getConnection();
            try {
               connection.update(AuthDB.DELETE_REALM_USER_AUTHENTICATION, new DBUpdateHandler() {
                  public void prepare(PreparedStatement s)
                     throws SQLException
                  {
                     s.setInt(1,id);
                     s.setInt(2,realm.getId());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.