XStatement stat = con.createStatement() ;
XResultSet set = stat.executeQuery("SELECT * FROM " + table) ;
XResultSetUpdate updt = (XResultSetUpdate) UnoRuntime.queryInterface
(XResultSetUpdate.class, set) ;
XRowUpdate rowUpdt = (XRowUpdate) UnoRuntime.queryInterface
(XRowUpdate.class, set) ;
updt.moveToInsertRow() ;
for (int i = 0; i < values.length; i++) {
if (values[i] instanceof String) {
rowUpdt.updateString(TST_STRING, (String) values[i]) ;
} else
if (values[i] instanceof Integer) {
rowUpdt.updateInt(TST_INT, ((Integer) values[i]).intValue()) ;
} else
if (values[i] instanceof Double) {
rowUpdt.updateDouble(TST_DOUBLE, ((Double) values[i]).doubleValue()) ;
} else
if (values[i] instanceof Date) {
rowUpdt.updateDate(TST_DATE, (Date) values[i]) ;
} else
if (values[i] instanceof Boolean) {
rowUpdt.updateBoolean(TST_BOOLEAN, ((Boolean) values[i]).booleanValue()) ;
} else
if (values[i] instanceof XTextInputStream) {
rowUpdt.updateCharacterStream(TST_CHARACTER_STREAM, (XInputStream) values[i],
streamLength) ;
} else
if (values[i] instanceof XDataInputStream) {
rowUpdt.updateBinaryStream(TST_BINARY_STREAM, (XInputStream) values[i],
streamLength) ;
}
}
updt.insertRow() ;
XCloseable xClose = (XCloseable) UnoRuntime.queryInterface
(XCloseable.class, set) ;
xClose.close() ;
}