Package org.adbcj

Examples of org.adbcj.Value


      // Make sure we can select the row
      rs = connection.executeQuery("SELECT id FROM updates").get();
      assertNotNull(rs);
      assertEquals(rs.size(), 1);
      Value value = rs.get(0).get(0);
      assertEquals(value.getInt(), 1);

      // Rollback transaction
      connection.rollback().get();

      // select query should now be empty
View Full Code Here


    // Select the row
    ResultSet rs = connection.executeQuery("SELECT id FROM updates").get();
    assertNotNull(rs);
    assertEquals(rs.size(), 1);
    Value value = rs.get(0).get(0);
    assertEquals(value.getInt(), 1);
    assertEquals(value.getField().getColumnLabel(), "id");

    // Update nothing
    result = connection.executeUpdate("UPDATE updates SET id=1 WHERE id=2").get();
    assertNotNull(result);
    assertEquals(result.getAffectedRows(), Long.valueOf(0));
View Full Code Here

  }

  @Override
  public Value get(Object key) {
    Field field = resultSet.getField(key);
    Value value = values[field.getIndex()];
    return value;
  }
View Full Code Here

    int fieldCount = input.readUnsignedShort();
    Value[] values = new Value[fieldCount];
    for (int i = 0; i < fieldCount; i++) {
      int valueLength = input.readInt();
      PgField field = fields[i];
      Value value;
      if (valueLength < 0) {
        value = new DefaultValue(field, null);
      } else {
        String strVal;
        switch (field.getColumnType()) {
View Full Code Here

TOP

Related Classes of org.adbcj.Value

Copyright © 2018 www.massapicom. 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.