Hi umpirsky:
I am not sure whether this will solve your problem.
However, will using two parameters work better?
For example:
String insertsql = "insert into testdbsize (name, address) values
(?,
?)";
PreparedStatement insertFirst = cs1.prepareStatement(insertsql,
Statement.RETURN_GENERATED_KEYS);
String name = new String("ABCD");
String address = new String("333 Glory Lily");
insertFirst.setString(1, name);
insertFirst.setString(2, address);
int result = insertFirst.executeUpdate();
if (result != 0) {
System.out.println("insert data to testdbsize");
}
ResultSet rs = insertFirst.getGeneratedKeys();
while (rs.next()) {
System.out.println("The generated key id is: " + rs.getInt(1));
}
rs.close();
insertFirst.close();
Also, does it matter if using column tag instead of "column name"
tag?
For example:
<id name="id" column="ID">
<generator class="increment"/>
</id>
Hope this help,
Lily