use of org.postgresql.jdbc.PgConnection in project com.revolsys.open by revolsys.
the class PostgreSQLRecordStore method getJdbcConnection.
@Override
public JdbcConnection getJdbcConnection(final boolean autoCommit) {
final DataSource dataSource = getDataSource();
final Connection connection = JdbcUtils.getConnection(dataSource);
try {
final PgConnection pgConnection = connection.unwrap(PgConnection.class);
pgConnection.addDataType("geometry", PostgreSQLGeometryWrapper.class);
pgConnection.addDataType("box2d", PostgreSQLBoundingBoxWrapper.class);
pgConnection.addDataType("box3d", PostgreSQLBoundingBoxWrapper.class);
pgConnection.addDataType("tid", PostgreSQLTidWrapper.class);
} catch (final SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return new JdbcConnection(connection, dataSource, autoCommit);
}
Aggregations