Search in sources :

Example 11 with JDOConnection

use of javax.jdo.datastore.JDOConnection in project hive by apache.

the class MetaStoreDirectSql method executeNoResult.

private void executeNoResult(final String queryText) throws SQLException {
    JDOConnection jdoConn = pm.getDataStoreConnection();
    Statement statement = null;
    boolean doTrace = LOG.isDebugEnabled();
    try {
        long start = doTrace ? System.nanoTime() : 0;
        statement = ((Connection) jdoConn.getNativeConnection()).createStatement();
        statement.execute(queryText);
        MetastoreDirectSqlUtils.timingTrace(doTrace, queryText, start, doTrace ? System.nanoTime() : 0);
    } finally {
        if (statement != null) {
            statement.close();
        }
        // We must release the connection before we call other pm methods.
        jdoConn.close();
    }
}
Also used : Statement(java.sql.Statement) JDOConnection(javax.jdo.datastore.JDOConnection)

Aggregations

JDOConnection (javax.jdo.datastore.JDOConnection)11 Connection (java.sql.Connection)8 SQLException (java.sql.SQLException)6 Statement (java.sql.Statement)6 ResultSet (java.sql.ResultSet)4 PersistenceManager (javax.jdo.PersistenceManager)4 JDOObjectNotFoundException (javax.jdo.JDOObjectNotFoundException)3 Transaction (javax.jdo.Transaction)3 JDOException (javax.jdo.JDOException)2 MetaException (org.apache.hadoop.hive.metastore.api.MetaException)2 NoSuchObjectException (org.apache.hadoop.hive.metastore.api.NoSuchObjectException)2 DB (com.mongodb.DB)1 PreparedStatement (java.sql.PreparedStatement)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 JDOOptimisticVerificationException (javax.jdo.JDOOptimisticVerificationException)1 JDOUnsupportedOptionException (javax.jdo.JDOUnsupportedOptionException)1 JDOUserCallbackException (javax.jdo.JDOUserCallbackException)1 JDOUserException (javax.jdo.JDOUserException)1 PersistenceManagerFactory (javax.jdo.PersistenceManagerFactory)1