Skip to content

Commit

Permalink
unwrap connection from BaseConnection in executePgCopy to avoid possi…
Browse files Browse the repository at this point in the history
…ble ClassCastException if it unwrapped from Connection
  • Loading branch information
jensberke committed Apr 28, 2015
1 parent f643945 commit 283bc2c
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -107,7 +107,7 @@ public void executePgCopy(Connection connection, String sql) throws SQLException
String statement = sql.substring(0, split);
String data = sql.substring(split + 1).trim();

CopyManager copyManager = new CopyManager((BaseConnection) connection.unwrap(Connection.class));
CopyManager copyManager = new CopyManager((BaseConnection) connection.unwrap(BaseConnection.class));
try {
copyManager.copyIn(statement, new StringReader(data));
} catch (IOException e) {
Expand Down

0 comments on commit 283bc2c

Please sign in to comment.