Package org.h2.command.dml

Examples of org.h2.command.dml.Insert.addRow()


                    ExpressionColumn expr = (ExpressionColumn) p.parseExpression(tab);
                    String schemaName = expr.getOriginalTableAliasName();
                    String tableName = expr.getColumnName();
                    q = q.substring(idx + " WHERE ".length());
                    Object[][] columnData = parseKey(conn, q);
                    result.addRow(
                            schemaName,
                            tableName,
                            columnData[0],
                            columnData[1],
                            score);
View Full Code Here


                            tableName,
                            columnData[0],
                            columnData[1],
                            score);
                } else {
                    result.addRow(q, score);
                }
            }
            /*## LUCENE2 begin ##
            // TODO keep it open if possible
            reader.close();
View Full Code Here

                }
                Object[] o = new Object[columns];
                for (int i = 0; i < columns; i++) {
                    o[i] = readValue().getObject();
                }
                rs.addRow(o);
            }
            return ValueResultSet.get(rs);
        }
        default:
            throw DbException.get(ErrorCode.CONNECTION_BROKEN_1, "type=" + type);
View Full Code Here

                  String[] splits = key.split("=");
                  String[] col0 = new String[1];
                  col0[0] = splits[0];
                  String[] col1 = new String[1];
                  col1[0] = splits[1];
                    result.addRow(
                            index.schema,
                            index.table,
                            col0,
                            col1,
                            1.0);
View Full Code Here

                            1.0);
                } else {
                    String query = StringUtils.quoteIdentifier(index.schema) +
                        "." + StringUtils.quoteIdentifier(index.table) +
                        " WHERE " + key;
                    result.addRow(query, 1.0);
                }
                rowCount++;
                if (limit > 0 && rowCount >= limit) {
                    break;
                }
View Full Code Here

    rs = stmt.executeQuery("SELECT COUNT(*) FROM Customers");
    rs.next();
    int noc = rs.getInt(1);
    SimpleResultSet srs = new SimpleResultSet();
    srs.addColumn("averageCreditLimit", Types.DOUBLE, 20, 0);
    srs.addRow(new Object[] { (sum / noc) });
    return srs;
  }

  public static ResultSet getCustomerPhoneNumber(Connection conn,
      int customerNumber) throws SQLException {
View Full Code Here

    ResultSet rs = stmt.executeQuery();
    rs.next();
    String phoneNo = rs.getString(1);
    SimpleResultSet srs = new SimpleResultSet();
    srs.addColumn("phoneNumber", Types.VARCHAR, 255, 0);
    srs.addRow(new Object[] { phoneNo });
    return srs;
  }

}
View Full Code Here

                        s = s.substring(0, dot + 1);
                    }
                }
                row[i] = s;
            }
            rs2.addRow(row);
        }
        BufferedWriter writer = new BufferedWriter(new FileWriter(out));
        writer.write("# Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License,\n" +
                "# Version 1.0, and under the Eclipse Public License, Version 1.0\n" +
                "# (http://h2database.com/html/license.html).\n" +
View Full Code Here

     */
    public static ResultSet simpleResultSet() {
        SimpleResultSet rs = new SimpleResultSet();
        rs.addColumn("ID", Types.INTEGER, 10, 0);
        rs.addColumn("NAME", Types.VARCHAR, 255, 0);
        rs.addRow(0, "Hello");
        return rs;
    }

    /**
     * Creates a simple result set with two columns.
View Full Code Here

        if (url.equals("jdbc:columnlist:connection")) {
            return rs;
        }
        for (int s = size.intValue(), x = 0; x < s; x++) {
            for (int y = 0; y < s; y++) {
                rs.addRow(x, y);
            }
        }
        return rs;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.