Package com.iCo6.util.org.apache.commons.dbutils

Examples of com.iCo6.util.org.apache.commons.dbutils.QueryRunner.query()


                QueryRunner run = new QueryRunner();

                try {
                    try{
                        run.query(old, "SELECT * FROM " + table, new ResultSetHandler(){
                            public Object handle(ResultSet rs) throws SQLException {
                                Account current = null;
                                Boolean next = rs.next();

                                if(next)
View Full Code Here


            QueryRunner run = new QueryRunner();
            Connection c = iConomy.Database.getConnection();

            try {
                String t = Constants.Nodes.DatabaseTable.toString();
                exists = run.query(c, "SELECT id FROM " + t + " WHERE username=?", returnBoolean, name.toLowerCase());
            } catch (SQLException ex) {
                System.out.println("[iConomy] Error issueing SQL query: " + ex);
            } finally {
                DbUtils.close(c);
            }
View Full Code Here

            QueryRunner run = new QueryRunner();
            Connection c = iConomy.Database.getConnection();

            try{
                String t = Constants.Nodes.DatabaseTable.toString();
                balance = run.query(c, "SELECT balance FROM " + t + " WHERE username=?", returnBalance, name.toLowerCase());
            } catch (SQLException ex) {
                System.out.println("[iConomy] Error issueing SQL query: " + ex);
            } finally {
                DbUtils.close(c);
            }
View Full Code Here

            QueryRunner run = new QueryRunner();
            Connection c = iConomy.Database.getConnection();

            try{
                String t = Constants.Nodes.DatabaseTable.toString();
                status = run.query(c, "SELECT status FROM " + t + " WHERE username=?", returnStatus, name.toLowerCase());
            } catch (SQLException ex) {
                System.out.println("[iConomy] Error issueing SQL query: " + ex);
            } finally {
                DbUtils.close(c);
            }
View Full Code Here

            Connection conn = getConnection();
            QueryRunner run = new QueryRunner();

            try {
                String t = Constants.Nodes.DatabaseTable.toString();
                exists = run.query(conn, "SELECT id FROM " + table, returnBoolean);
            finally {
                DbUtils.close(conn);
            }
        } catch (SQLException e) {
            exists = false;
View Full Code Here

            QueryRunner run = new QueryRunner();
            Connection c = iConomy.Database.getConnection();

            try{
                String t = Constants.Nodes.DatabaseTable.toString();
                accounts = run.query(c, "SELECT username FROM " + t, returnList);
            } catch (SQLException ex) {
                System.out.println("[iConomy] Error issueing SQL query: " + ex);
            } finally {
                DbUtils.close(c);
            }
View Full Code Here

                QueryRunner run = new QueryRunner();
                Connection c = iConomy.Database.getConnection();

                try{
                    String t = Constants.Nodes.DatabaseTable.toString();
                    total = run.query(c, "SELECT username FROM " + t + " WHERE status <> 1 ORDER BY balance DESC LIMIT " + amount, returnList);
                } catch (SQLException ex) {
                    System.out.println("[iConomy] Error issueing SQL query: " + ex);
                } finally {
                    DbUtils.close(c);
                }
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.