Package org.milowski.db

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


      throws SQLException
   {
      final Slot<User> user = new Slot<User>();
      final DBConnection connection = getConnection();
      try {
         connection.query(USER_BY_EMAIL, new DBQueryHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setString(1, email);
            }
View Full Code Here


      throws SQLException
   {
      final Slot<Iterator<User>> result = new Slot<Iterator<User>>();
      final DBConnection connection = getConnection();
      try {
         connection.query(all ? USERS : GLOBAL_USERS, new DBQueryHandler() {
            public boolean shouldClose() { return false; }
            public void onResults(ResultSet set)
               throws SQLException
            {
               result.set(new DBIterator<User>(set,new DBResultConstructor<User>() {
View Full Code Here

   {
      final Slot<Iterator<Group>> result = new Slot<Iterator<Group>>();
      final DBCache<UUID,Group> cache = realmGroupCaches.get(realm);
      final DBConnection connection = getConnection();
      try {
         connection.query(GROUPS, new DBQueryHandler() {
            public boolean shouldClose() { return false; }
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,realm.getId());
View Full Code Here

      final Slot<Boolean> found = new Slot<Boolean>(false);
      if (alias!=null) {
         // check realm against alias
         DBConnection connection = getConnection();
         try {
            connection.query(REALM_USER_BY_ALIAS, new DBQueryHandler() {
               public void prepare(PreparedStatement s)
                  throws SQLException
               {
                  s.setInt(1,realm.getId());
                  s.setString(2,alias);
View Full Code Here

            });
            if (found.get()) {
               return false;
            }
            // check inherited aliases
            connection.query(REALM_USER_HAS_INHERITED_ALIAS, new DBQueryHandler() {
               public void prepare(PreparedStatement s)
                  throws SQLException
               {
                  s.setInt(1,realm.getId());
                  s.setString(2,alias);
View Full Code Here

      //
      if (alias==null) {
         // Check inherited alias against local aliases
         DBConnection connection = getConnection();
         try {
            connection.query(REALM_USER_BY_ALIAS, new DBQueryHandler() {
               public void prepare(PreparedStatement s)
                  throws SQLException
               {
                  s.setInt(1,realm.getId());
                  s.setString(2,user.getAlias());
View Full Code Here

      throws SQLException
   {
      final Slot<RealmUser> ruser = new Slot<RealmUser>();
      final DBConnection connection = getConnection();
      try {
         connection.query(REALM_USER_BY_EMAIL, new DBQueryHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,realm.getId());
               s.setString(2, email);
View Full Code Here

         if (ruser.get()!=null) {
            return ruser.get();
         }
         final User user = findUserByEmail(email);
         if (user!=null) {
            connection.query(REALM_USER_BY_USER, new DBQueryHandler() {
               public void prepare(PreparedStatement s)
                  throws SQLException
               {
                  s.setInt(1,realm.getId());
                  s.setInt(2, user.getId());
View Full Code Here

   {
      final DBCache<UUID,RealmUser> cache = realmUserCaches.get(realm);
      final Slot<Iterator<RealmUser>> result = new Slot<Iterator<RealmUser>>();
      final DBConnection connection = getConnection();
      try {
         connection.query(REALM_USERS, new DBQueryHandler() {
            public boolean shouldClose() { return false; }
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,realm.getId());
View Full Code Here

      throws SQLException
   {
      final Slot<User.Authenticated> retval = new Slot<User.Authenticated>();
      DBConnection connection = getConnection();
      try {
         connection.query(USER_SESSION, new DBQueryHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setString(1,session.toString());
            }
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.