mil.dod.th.ose.core/src/mil/dod/th/ose/core/impl/persistence/AbstractDataStore.java
protected <T> T executeSql(final String statementText, final ResultHandler<T> handler) throws SQLException
    {
        synchronized (this)
        {
            final JDOConnection conn = getPersistenceManager().getDataStoreConnection();
            
            try
            {
                m_WakeLock.activate();

                @SuppressWarnings("resource") // compiler thinks sqlConn is not closed but it is by conn defined above
                final java.sql.Connection sqlConn = (java.sql.Connection)conn;
                
                try (Statement statement = sqlConn.createStatement())
                {
                    final boolean result = statement.execute(statementText);
                    if (handler == null)
                    {
                        return null;
                    }
                    else
                    {
                        return handler.statementExecuted(result, statement);
                    }
                }
            }
            finally
            {
                conn.close();

                m_WakeLock.cancel();
            }
        }
    }
/**
     * Execute an arbitrary SQL statement and handle the results with the given handler.
     * 
     * @param <T>
     *      type of the value return by this method, handler must be able to get this value from the statement results
     * @param statementText
     *      text of SQL statement to execute
     * @param handler
     *      handles the results of the statement execution, null if nothing to handle
     * @return
     *      data returned from the execute statement, handler dependent
     * @throws SQLException
     *      if their is a failure to execute the SQL statement
     */
Execute an arbitrary SQL statement and handle the results with the given handler.


Execute an arbitrary SQL statement and handle the results with the given handler .
protected <T> T executeSql(final String statementText, final ResultHandler<T> handler) throws SQLException
    {
        synchronized (this)
        {
            final JDOConnection conn = getPersistenceManager().getDataStoreConnection();
            try
            {
                m_WakeLock.activate();
                @SuppressWarnings("resource") 
                final java.sql.Connection sqlConn = (java.sql.Connection)conn;
                try (Statement statement = sqlConn.createStatement())
                {
                    final boolean result = statement.execute(statementText);
                    if (handler == null)
                    {
                        return null;
                    }
                    else
                    {
                        return handler.statementExecuted(result, statement);
                    }
                }
            }
            finally
            {
                conn.close();
                m_WakeLock.cancel();
            }
        }
    }
protected < T > T executeSql ( final String statementText , final ResultHandler < T > handler ) throws SQLException { synchronized ( this ) { final JDOConnection conn = getPersistenceManager ( ) . getDataStoreConnection ( ) ; try { m_WakeLock . activate ( ) ; @ SuppressWarnings ( "resource" ) final java . sql . Connection sqlConn = ( java . sql . Connection ) conn ; try ( Statement statement = sqlConn . createStatement ( ) ) { final boolean result = statement . execute ( statementText ) ; if ( handler == null ) { return null ; } else { return handler . statementExecuted ( result , statement ) ; } } } finally { conn . close ( ) ; m_WakeLock . cancel ( ) ; } } }
Execute an arbitrary SQL statement and handle the results with the given handler.
Execute an arbitrary SQL statement and handle the results with the given handler .
// compiler thinks sqlConn is not closed but it is by conn defined above