final byte[][] strings = new byte[2][];
strings[0] = new byte[] { 0x00, 0x48, 0x00, 0x65, 0x00, 0x6C, 0x00, 0x6C, 0x00, 0x6F };
strings[1] = new byte[] { 0x00, 0x57, 0x00, 0x6F, 0x00, 0x72, 0x00, 0x6C, 0x00, 0x64 };
final SeCoordinateReference coordref = layer.getCoordRef();
final SeShape shapes[] = new SeShape[2];
for (int i = 0; i < shapes.length; i++) {
Geometry geom = geoms[i];
SeShape shape;
if (geom == null) {
shape = null;
} else {
ArcSDEGeometryBuilder builder = ArcSDEGeometryBuilder.builderFor(geom.getClass());
shape = builder.constructShape(geom, coordref);
}
shapes[i] = shape;
}
/*
* Define the names of the columns that data is to be inserted into.
*/
final String[] columns = new String[colDefs.length];
// Column one will be the row_id
for (int j = 1; j < colDefs.length; j++) {
columns[j - 1] = colDefs[j].getName(); // INT32 column
}
columns[colDefs.length - 1] = "SHAPE"; // Shape column
Command<Void> insertDataCmd = new Command<Void>() {
@Override
public Void execute(ISession session, SeConnection connection) throws SeException,
IOException {
SeInsert insert = new SeInsert(connection);
insert.intoTable(layer.getName(), columns);
insert.setWriteMode(true);
try {
for (int i = 0; i < shapes.length; i++) {
SeRow row = insert.getRowToSet();
row.setClob(0, new ByteArrayInputStream(strings[i]));
SeShape seShape = shapes[i];
row.setShape(tempTableColumns.length - 1, seShape);
insert.execute();
}
} finally {