Paul,
there is a bug in the code you send, if this is the original code may be
this has cause it. see inline comment:
-Arno
> public void performInsert(String tableName,
> String[0 colNames, String[] colContents)
> {
> StringBuffer buff = new StringBuffer();
> buff.append("INSERT INTO ");
> buff.append(tableName);
> buff.append(" (");
> // prepare a prepared statement
> int numCol = 0;
> for( int i=0; i<colNames.length; i++) {
> if (i > 0 ) buff.append(",");
> buff.append(colNames[i]);
> }
> buff.append(") VALUES (");
> for(int i=0; i< colContents.length; i++) {
> if ( i>0) buff.append(",?");
> else buff.append("?)");
> }
> System.out.println("Executing prepared statement :
> " + buff.toString());
>
> // send commands
> try {
> java.sql.PreparedStatement stmt =
>
> connection.prepareStatement(buff.toString());
> int i=0;
> for(int i=0; i< colContents.length; i++) {
> stmt.setString(colContents.toString());
should be: stmt.setString(colContents[i].toString());
> }
> stmt.execute();
> stmt.close();
> }
> ------------------------------------------------------------------
> -----------
> To unsubscribe from this mailing list, send email to majordomo@enhydra.org
> with the text "unsubscribe instantdb" in the body of the email.
> If you have other questions regarding this mailing list, send email to
> the list admin at owner-instantdb@enhydra.org.
-----------------------------------------------------------------------------
To unsubscribe from this mailing list, send email to majordomo@enhydra.org
with the text "unsubscribe instantdb" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at owner-instantdb@enhydra.org.
|