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:
parent
e247617063
commit
f47a4fc25c
@ -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);
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user