rs.close();
    public static void insert(Context context, TableRow row)            throws SQLException    {        String table = canonicalize(row.getTable());        // Get an ID (primary key) for this row by using the "getnextid"        // SQL function in Postgres, or directly with sequences in Oracle        String myQuery = "SELECT getnextid('" + table + "') AS result";        if ("oracle".equals(ConfigurationManager.getProperty("db.name")))        {            myQuery = "SELECT " + table + "_seq" + ".nextval FROM dual";        }        Statement statement = context.getDBConnection().createStatement();        ResultSet rs = statement.executeQuery(myQuery);        rs.next();        int newID = rs.getInt(1);        statement.close();        // Set the ID in the table row object        row.setColumn(getPrimaryKeyColumn(table), newID);        StringBuffer sql = new StringBuffer().append("INSERT INTO ").append(                table).append(" ( ");        ColumnInfo[] info = getColumnInfo(table);        for (int i = 0; i < info.length; i++)        {            sql.append((i == 0) ? "" : ",").append(info[i].getName());        }        sql.append(") VALUES ( ");        // Values to insert        for (int i = 0; i < info.length; i++)        {            sql.append((i == 0) ? "" : ",").append("?");        }        // Watch the syntax        sql.append(")");        execute(context.getDBConnection(), sql.toString(), Arrays.asList(info),                row);    }