@@ -123,12 +123,13 @@ protected void setStatementParameters(final ThreadContext context,
123123 final Connection connection , final PreparedStatement statement ,
124124 final List <?> binds ) throws SQLException {
125125
126- ((PGConnection ) connection ).addDataType ("daterange" , DateRangeType .class );
127- ((PGConnection ) connection ).addDataType ("tsrange" , TsRangeType .class );
128- ((PGConnection ) connection ).addDataType ("tstzrange" , TstzRangeType .class );
129- ((PGConnection ) connection ).addDataType ("int4range" , Int4RangeType .class );
130- ((PGConnection ) connection ).addDataType ("int8range" , Int8RangeType .class );
131- ((PGConnection ) connection ).addDataType ("numrange" , NumRangeType .class );
126+ final PGConnection pgConnection = connection .unwrap (PGConnection .class );
127+ pgConnection .addDataType ("daterange" , DateRangeType .class );
128+ pgConnection .addDataType ("tsrange" , TsRangeType .class );
129+ pgConnection .addDataType ("tstzrange" , TstzRangeType .class );
130+ pgConnection .addDataType ("int4range" , Int4RangeType .class );
131+ pgConnection .addDataType ("int8range" , Int8RangeType .class );
132+ pgConnection .addDataType ("numrange" , NumRangeType .class );
132133
133134 super .setStatementParameters (context , connection , statement , binds );
134135 }
0 commit comments