Package org.milowski.db

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


      // delete any expired sessions for the user
      final Timestamp created = new Timestamp(System.currentTimeMillis());
      DBConnection connection = db.getConnection();
      try {
         connection.update(AuthDB.DELETE_EXPIRED_SESSIONS, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,id);
               s.setTimestamp(2,created);
View Full Code Here


            //construct an auth record with a session id
            final UUID theSession = session==null ? UUID.randomUUID() : session;
            final Timestamp expiration = new Timestamp(created.getTime()+expires);
            connection = db.getConnection();
            try {
               connection.update(AuthDB.CREATE_AUTHENTICATED, new DBUpdateHandler() {
                  public void prepare(PreparedStatement s)
                     throws SQLException
                  {
                     s.setInt(1,id);
                     if (realm==null) {
View Full Code Here

      // delete any expired sessions for the user
      final Timestamp created = new Timestamp(System.currentTimeMillis());
      DBConnection connection = db.getConnection();
      try {
         connection.update(AuthDB.DELETE_EXPIRED_SESSIONS, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,id);
               s.setTimestamp(2,created);
View Full Code Here

         //construct an auth record with a session id
         final UUID session = UUID.randomUUID();
         final Timestamp expiration = new Timestamp(created.getTime()+expires);
         connection = db.getConnection();
         try {
            connection.update(AuthDB.CREATE_AUTHENTICATED, new DBUpdateHandler() {
               public void prepare(PreparedStatement s)
                  throws SQLException
               {
                  s.setInt(1,id);
                  if (realm==null) {
View Full Code Here

      if (permissions.contains(p)) {
         return true;
      }
      DBConnection connection = db.getConnection();
      try {
         connection.update(AuthDB.CREATE_ROLE_PERMISSION, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1, id);
               s.setInt(2, p.getId());
View Full Code Here

   public boolean removePermission(final Permission p)
      throws SQLException
   {
      DBConnection connection = db.getConnection();
      try {
         connection.update(AuthDB.DELETE_ROLE_PERMISSION, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1, id);
               s.setInt(2, p.getId());
View Full Code Here

      if (roles.contains(role)) {
         return true;
      }
      DBConnection connection = db.getConnection();
      try {
         connection.update(AuthDB.CREATE_GROUP_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.DELETE_GROUP_ROLE, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,id);
               s.setInt(2,role.getId());
View Full Code Here

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

   public boolean removeMember(final RealmUser user)
      throws SQLException
   {
      DBConnection connection = db.getConnection();
      try {
         return connection.update(AuthDB.DELETE_GROUP_MEMBER, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,id);
               s.setInt(2,user.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.