Package org.h2.result

Examples of org.h2.result.LocalResult.addRow()


                map = "" + conn.getTypeMap();
            } catch (SQLException e) {
                map = e.toString();
            }
            rs.addRow("conn.getTypeMap", "" + map);
            rs.addRow("conn.isReadOnly", "" + conn.isReadOnly());
            rs.addRow("conn.getHoldability", "" + conn.getHoldability());
            addDatabaseMetaData(rs, meta);
            return rs;
        } else if (isBuiltIn(sql, "@attributes")) {
            String[] p = split(sql);
View Full Code Here


            } catch (SQLException e) {
                map = e.toString();
            }
            rs.addRow("conn.getTypeMap", "" + map);
            rs.addRow("conn.isReadOnly", "" + conn.isReadOnly());
            rs.addRow("conn.getHoldability", "" + conn.getHoldability());
            addDatabaseMetaData(rs, meta);
            return rs;
        } else if (isBuiltIn(sql, "@attributes")) {
            String[] p = split(sql);
            return meta.getAttributes(p[1], p[2], p[3], p[4]);
View Full Code Here

        } else if (isBuiltIn(sql, "@prof_stop")) {
            if (profiler != null) {
                profiler.stopCollecting();
                SimpleResultSet rs = new SimpleResultSet();
                rs.addColumn("Top Stack Trace(s)", Types.VARCHAR, 0, 0);
                rs.addRow(profiler.getTop(3));
                profiler = null;
                return rs;
            }
        }
        return null;
View Full Code Here

                    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

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.