3838import java .util .Date ;
3939import oracle .spatial .geometry .JGeometry ;
4040import oracle .spatial .util .WKT ;
41- import oracle .sql .STRUCT ;
4241import org .apache .hop .core .Const ;
4342import org .apache .hop .core .database .DatabaseMeta ;
4443import org .apache .hop .core .database .IDatabase ;
@@ -624,7 +623,7 @@ public Object getValueFromResultSet(IDatabase databaseInterface, ResultSet resul
624623
625624 if (resultSet .getObject (index + 1 ) != null ) {
626625
627- STRUCT st = ( oracle . sql . STRUCT ) resultSet .getObject (index + 1 );
626+ byte [] st = resultSet .getBytes (index + 1 );
628627 JGeometry ociGeometry = JGeometry .load (st );
629628 srid = ociGeometry .getSRID ();
630629
@@ -647,7 +646,18 @@ public Object getValueFromResultSet(IDatabase databaseInterface, ResultSet resul
647646 }
648647
649648 String wkt = new String (ociWktReaderWriter .fromJGeometry (ociGeometry ));
650- geometry = new WKTReader ().read (wkt );
649+ try {
650+ geometry = new WKTReader ().read (wkt );
651+ } catch (ParseException e ) {
652+ throw new HopDatabaseException (
653+ toStringMeta ()
654+ + " : Unable to get Geometry item '"
655+ + wkt
656+ + "' from resultset at index "
657+ + index
658+ + " for "
659+ + databaseInterface .getDriverClass ().toString ());
660+ }
651661 }
652662
653663 // MySQL
@@ -831,6 +841,7 @@ public void setPreparedStatementValue(
831841 if (geometry .getSRID () > 0 ) {
832842 ociGeometry .setSRID (geometry .getSRID ());
833843 }
844+
834845 preparedStatement .setObject (
835846 index , JGeometry .store (ociGeometry , preparedStatement .getConnection ()), Types .STRUCT );
836847
0 commit comments