Package org.apache.commons.dbutils.handlers

Examples of org.apache.commons.dbutils.handlers.ArrayHandler


    {
        Connection con = null;
        try
        {
            con = getConnection();
            return (Object[])new QueryRunner().query(con, sql, new ArrayHandler());
        }
        finally
        {
            JdbcUtils.close(con);
        }
View Full Code Here


            public boolean isSatisfied()
            {
                try
                {
                    Object[] queryResult = (Object[]) qr.query(jdbcConnector.getConnection(),
                        "SELECT DATA FROM TEST WHERE TYPE = 1 AND ACK IS NULL", new ArrayHandler());
                    // Delivery was successful so row should be acknowledged (marked read).
                    return (queryResult == null);
                }
                catch (Exception e)
                {
View Full Code Here

            public boolean isSatisfied()
            {
                try
                {
                    Object[] queryResult = (Object[]) qr.query(jdbcConnector.getConnection(),
                        "SELECT DATA FROM TEST WHERE TYPE = 2 AND ACK IS NULL", new ArrayHandler());
                    // Delivery failed so row should not be acknowledged (marked read).
                    return (queryResult != null && queryResult.length == 1);
                }
                catch (Exception e)
                {
View Full Code Here

            public boolean isSatisfied()
            {
                try
                {
                    Object[] queryResult = (Object[]) qr.query(jdbcConnector.getConnection(),
                        "SELECT DATA FROM TEST WHERE TYPE = 3 AND ACK IS NULL", new ArrayHandler());
                    // Delivery failed so row should not be acknowledged (marked read).
                    return (queryResult != null && queryResult.length == 1);
                }
                catch (Exception e)
                {
View Full Code Here

            public boolean isSatisfied()
            {
                try
                {
                    Object[] queryResult = (Object[]) qr.query(jdbcConnector.getConnection(),
                        "SELECT DATA FROM TEST WHERE TYPE = 4 AND ACK IS NULL", new ArrayHandler());
                    // Exception occurs after the SEDA queue for an asynchronous request, so from the client's
                    // perspective, the message has been delivered successfully.
                    return (queryResult == null);
                }
                catch (Exception e)
View Full Code Here

            public boolean isSatisfied()
            {
                try
                {
                    Object[] queryResult = (Object[]) qr.query(jdbcConnector.getConnection(),
                        "SELECT DATA FROM TEST WHERE TYPE = 2 AND ACK IS NULL", new ArrayHandler());
                    // Exception occurs after the SEDA queue for an asynchronous request, so from the client's
                    // perspective, the message has been delivered successfully.
                    // Note that this behavior is different from services because the exception occurs before
                    // the SEDA queue for services.
                    return (queryResult == null);
View Full Code Here

            public boolean isSatisfied()
            {
                try
                {
                    Object[] queryResult = (Object[]) qr.query(jdbcConnector.getConnection(),
                        "SELECT DATA FROM TEST WHERE TYPE = 3 AND ACK IS NULL", new ArrayHandler());
                    // Exception occurs after the SEDA queue for an asynchronous request, so from the client's
                    // perspective, the message has been delivered successfully.
                    // Note that this behavior is different from services because the exception occurs before
                    // the SEDA queue for services.
                    return (queryResult == null);
View Full Code Here

            public boolean isSatisfied()
            {
                try
                {
                    Object[] queryResult = (Object[]) qr.query(jdbcConnector.getConnection(),
                        "SELECT DATA FROM TEST WHERE TYPE = 4 AND ACK IS NULL", new ArrayHandler());
                    // Although a component exception occurs after the SEDA queue, the use of transactions
                    // bypasses the SEDA queue, so message should get redelivered.
                    return (queryResult != null && queryResult.length == 1);
                }
                catch (Exception e)
View Full Code Here

    private ArrayHandler arrayHandler;

    public JdbcObjectStore()
    {
        this.arrayHandler = new ArrayHandler();
        this.maxEntries = -1;
    }
View Full Code Here

        MuleClient client = new MuleClient(muleContext);
        client.send("jdbc://writeTest?type=2", new DefaultMuleMessage(TEST_MESSAGE, muleContext));

        QueryRunner qr = jdbcConnector.getQueryRunner();
        Object[] obj2 =
            (Object[]) qr.query(jdbcConnector.getConnection(), "SELECT DATA FROM TEST WHERE TYPE = 2", new ArrayHandler());
        assertNotNull(obj2);
        assertEquals(1, obj2.length);
        assertEquals(TEST_MESSAGE, obj2[0]);
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.dbutils.handlers.ArrayHandler

Copyright © 2018 www.massapicom. 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.