@@ -119,19 +119,22 @@ protected String caseConvertIdentifierForJdbc(final Connection connection, final
119119 }
120120
121121 @ Override
122- protected void setStatementParameters (final ThreadContext context ,
123- final Connection connection , final PreparedStatement statement ,
124- final List <?> binds ) throws SQLException {
125-
126- final PGConnection pgConnection = connection .unwrap (PGConnection .class );
122+ protected Connection newConnection () throws SQLException {
123+ final Connection connection = getConnectionFactory ().newConnection ();
124+ final PGConnection pgConnection ;
125+ if ( connection instanceof PGConnection ) {
126+ pgConnection = (PGConnection ) connection ;
127+ }
128+ else {
129+ pgConnection = connection .unwrap (PGConnection .class );
130+ }
127131 pgConnection .addDataType ("daterange" , DateRangeType .class );
128132 pgConnection .addDataType ("tsrange" , TsRangeType .class );
129133 pgConnection .addDataType ("tstzrange" , TstzRangeType .class );
130134 pgConnection .addDataType ("int4range" , Int4RangeType .class );
131135 pgConnection .addDataType ("int8range" , Int8RangeType .class );
132136 pgConnection .addDataType ("numrange" , NumRangeType .class );
133-
134- super .setStatementParameters (context , connection , statement , binds );
137+ return connection ;
135138 }
136139
137140 @ Override // due statement.setNull(index, Types.BLOB) not working :
0 commit comments