Package org.milowski.db

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


   protected void init()
      throws SQLException
   {
      DBConnection connection = db.getConnection();
      try {
         connection.query(AuthDB.GROUP_ROLES, new DBQueryHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1, id);
            }
View Full Code Here


      throws SQLException
   {
      final Slot<Boolean> member = new Slot<Boolean>(false);
      DBConnection connection = db.getConnection();
      try {
         connection.query(AuthDB.GROUP_MEMBER, new DBQueryHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,id);
               s.setInt(2,user.getId());
View Full Code Here

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

      if (!result) {
         final Slot<Boolean> found = new Slot<Boolean>(Boolean.FALSE);
         final DBCache<UUID,Group> cache = db.realmGroupCaches.get(realm);
         DBConnection connection = db.getConnection();
         try {
            connection.query(AuthDB.GROUP_BY_REALM_USER, new DBQueryHandler() {
               public void prepare(PreparedStatement s)
                  throws SQLException
               {
                  s.setInt(1,realm.getId());
                  s.setInt(2,id);
View Full Code Here

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

         final User user = userCache.get(id);
         if (user!=null) {
            final Slot<RealmUser> u = new Slot<RealmUser>();
            final DBConnection connection = getConnection();
            try {
               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

                     throws SQLException
                  {
                     if (set.next()) {
                        final int rid = set.getInt(1);
                        final Slot<String> alias = new Slot<String>();
                        connection.query(REALM_USER_ALIAS, new DBQueryHandler() {
                           public void prepare(PreparedStatement s)
                              throws SQLException
                           {
                              s.setInt(1,rid);
                           }
View Full Code Here

         throws SQLException
      {
         final Slot<RealmUser> u = new Slot<RealmUser>();
         final DBConnection connection = getConnection();
         try {
            connection.query(REALM_USER, new DBQueryHandler() {
               public void prepare(PreparedStatement s)
                  throws SQLException
               {
                  s.setInt(1,id.intValue());
               }
View Full Code Here

               public void onResults(ResultSet set)
                  throws SQLException
               {
                  if (set.next()) {
                     final Slot<String> alias = new Slot<String>();
                     connection.query(REALM_USER_ALIAS, new DBQueryHandler() {
                        public void prepare(PreparedStatement s)
                           throws SQLException
                        {
                           s.setInt(1,id);
                        }
View Full Code Here

      {
         final Slot<RealmUser> u = new Slot<RealmUser>();

         final 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,name);
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.