|
com.im.commons.db 5.9.2 | ||||||||
| PREV NEXT | FRAMES NO FRAMES | ||||||||
DBDatabaseInfo.ColumnSQLType enum values.
BeanDescriptors.
EventSetDescriptors.
MethodDescriptors.
PropertyDescriptors.
InitializationException without detail message.
InitializationException with the specified detail message.
SQLWriter sqlWriter = new SQLWriterRegistry() ;
SQLUpdateStatement update = new SQLUpdateStatement(sqlWriter);
update.setTable("foo");
SQLWhereClauseElement where = new SQLFilterElement(sqlWriter, "foo", new String[]{"baz"}, new int[]{Types.VARCHAR}, Operators.EQUALS, new Object[]{"mars"});
update.setWhereClause(where);
update.addValue("txtcol", TypesProvider.ColumnType.VARCHAR, "hello world");
update.addValue("intcol", TypesProvider.ColumnType.INTEGER, new Integer(99));
String sql = instance.generateSql();
// now execute the SQL
Will generate SQL like this:
UPDATE foo
SET txtcol = 'hello world', intcol = 99
WHERE foo.baz = 'mars'
TODO: add the ability to use a join as part of the where statement - currently
this implementation is limited to columns within the table being updated
|
com.im.commons.db 5.9.2 | ||||||||
| PREV NEXT | FRAMES NO FRAMES | ||||||||