mirror of
https://github.com/apache/sqoop.git
synced 2025-05-03 21:00:13 +08:00
SQOOP-1433: Oracle direct connector fails with Oracle 12c JDBC driver
(David Robson via Jarek Jarcec Cecho)
This commit is contained in:
parent
e247617063
commit
f47a4fc25c
@ -93,7 +93,9 @@ private static Connection createConnection(String jdbcUrl, String username,
|
||||
}
|
||||
|
||||
try {
|
||||
return DriverManager.getConnection(jdbcUrl, props);
|
||||
Connection result = DriverManager.getConnection(jdbcUrl, props);
|
||||
result.setAutoCommit(false);
|
||||
return result;
|
||||
} catch (SQLException ex) {
|
||||
String errorMsg = String.format(
|
||||
"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.setAutoCommit(false);
|
||||
|
||||
OraOopOracleQueries.setConnectionTimeZone(connection, conf);
|
||||
|
||||
setSessionClientInfo(connection, conf);
|
||||
|
@ -100,6 +100,7 @@ protected Connection getTestEnvConnection() throws SQLException {
|
||||
this.conn =
|
||||
DriverManager.getConnection(OracleUtils.CONNECT_STRING,
|
||||
OracleUtils.ORACLE_USER_NAME, OracleUtils.ORACLE_USER_PASS);
|
||||
this.conn.setAutoCommit(false);
|
||||
}
|
||||
return this.conn;
|
||||
}
|
||||
|
@ -153,6 +153,7 @@ public void importTest() throws Exception {
|
||||
}
|
||||
} finally {
|
||||
ps.close();
|
||||
conn.commit();
|
||||
}
|
||||
|
||||
// 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 {
|
||||
ps.close();
|
||||
conn.commit();
|
||||
}
|
||||
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user