5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-04 14:19:04 +08:00

SQOOP-1433: Oracle direct connector fails with Oracle 12c JDBC driver

(David Robson via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2014-09-02 09:36:41 +02:00
parent e247617063
commit f47a4fc25c
3 changed files with 8 additions and 1 deletions

View File

@ -93,7 +93,9 @@ private static Connection createConnection(String jdbcUrl, String username,
} }
try { try {
return DriverManager.getConnection(jdbcUrl, props); Connection result = DriverManager.getConnection(jdbcUrl, props);
result.setAutoCommit(false);
return result;
} catch (SQLException ex) { } catch (SQLException ex) {
String errorMsg = String.format( String errorMsg = String.format(
"Unable to obtain a JDBC connection to the URL \"%s\" as user \"%s\": ", "Unable to obtain a JDBC connection to the URL \"%s\" as user \"%s\": ",
@ -108,6 +110,8 @@ public static void initializeOracleConnection(Connection connection,
connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
connection.setAutoCommit(false);
OraOopOracleQueries.setConnectionTimeZone(connection, conf); OraOopOracleQueries.setConnectionTimeZone(connection, conf);
setSessionClientInfo(connection, conf); setSessionClientInfo(connection, conf);

View File

@ -100,6 +100,7 @@ protected Connection getTestEnvConnection() throws SQLException {
this.conn = this.conn =
DriverManager.getConnection(OracleUtils.CONNECT_STRING, DriverManager.getConnection(OracleUtils.CONNECT_STRING,
OracleUtils.ORACLE_USER_NAME, OracleUtils.ORACLE_USER_PASS); OracleUtils.ORACLE_USER_NAME, OracleUtils.ORACLE_USER_PASS);
this.conn.setAutoCommit(false);
} }
return this.conn; return this.conn;
} }

View File

@ -153,6 +153,7 @@ public void importTest() throws Exception {
} }
} finally { } finally {
ps.close(); ps.close();
conn.commit();
} }
// Can't bind > 4000 bytes of data to LONG and LOB columns in the same // Can't bind > 4000 bytes of data to LONG and LOB columns in the same
@ -168,6 +169,7 @@ public void importTest() throws Exception {
} }
} finally { } finally {
ps.close(); ps.close();
conn.commit();
} }
try { try {