Search in sources :

Example 16 with PGConnection

use of org.postgresql.PGConnection in project pentaho-kettle by pentaho.

the class PGBulkLoader method do_copy.

private void do_copy(PGBulkLoaderMeta meta, boolean wait) throws KettleException {
    data.db = getDatabase(this, meta);
    String copyCmd = getCopyCommand();
    try {
        connect();
        checkClientEncoding();
        processTruncate();
        logBasic("Launching command: " + copyCmd);
        pgCopyOut = new PGCopyOutputStream((PGConnection) data.db.getConnection(), copyCmd);
    } catch (Exception ex) {
        throw new KettleException("Error while preparing the COPY " + copyCmd, ex);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) PGCopyOutputStream(org.postgresql.copy.PGCopyOutputStream) PGConnection(org.postgresql.PGConnection) KettleException(org.pentaho.di.core.exception.KettleException) SQLException(java.sql.SQLException)

Aggregations

PGConnection (org.postgresql.PGConnection)16 SQLException (java.sql.SQLException)11 Connection (java.sql.Connection)7 LargeObjectManager (org.postgresql.largeobject.LargeObjectManager)5 IOException (java.io.IOException)4 LargeObject (org.postgresql.largeobject.LargeObject)4 ResultSet (java.sql.ResultSet)3 Statement (java.sql.Statement)3 GeometryMetadata (eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryMetadata)2 DelegatingConnection (org.apache.commons.dbcp2.DelegatingConnection)2 PGCopyOutputStream (org.postgresql.copy.PGCopyOutputStream)2 Resource (com.revolsys.spring.resource.Resource)1 Geometry (com.vividsolutions.jts.geom.Geometry)1 MultiLineString (com.vividsolutions.jts.geom.MultiLineString)1 MultiPoint (com.vividsolutions.jts.geom.MultiPoint)1 MultiPolygon (com.vividsolutions.jts.geom.MultiPolygon)1 Point (com.vividsolutions.jts.geom.Point)1 AbstractDBTest (eu.esdihumboldt.hale.io.jdbc.test.AbstractDBTest)1 JSonMapper (io.eventuate.javaclient.commonimpl.JSonMapper)1 BinLogEvent (io.eventuate.local.common.BinLogEvent)1