Package com.impossibl.postgres.types

Examples of com.impossibl.postgres.types.Type


      row[2] = rs.get(3);
      row[3] = rs.get(4);
      row[4] = rs.get(5);
      row[5] = rs.get(6);

      Type type = reg.loadType(rs.getInt(7));
      if (type != null) {
        row[6] = SQLTypeMetaData.getSQLType(type);
      }
      else {
        row[6] = null;
View Full Code Here


    if (resultFields.isEmpty() || resultFields.size() != updatedRowValues.length) {
      throw new SQLException("Invalid update row");
    }

    Type relType = connection.getRegistry().loadRelationType(resultFields.get(0).relationId);

    StringBuilder sb = new StringBuilder("INSERT INTO ");

    sb.append(relType.getName());

    sb.append(" VALUES (");

    Iterator<ResultField> fieldsIter = resultFields.iterator();
    int pid = 1;
View Full Code Here

    if (resultFields.size() != updatedRowValues.length) {
      throw new SQLException("Invalid update row");
    }

    Type relType = connection.getRegistry().loadRelationType(resultFields.get(0).relationId);

    StringBuilder sb = new StringBuilder("UPDATE ");

    sb.append(relType.getName());

    sb.append(" SET ");

    Iterator<ResultField> fieldsIter = resultFields.iterator();
    int pid = 1;
View Full Code Here

  void delete() throws SQLException {

    if (!isValidRow())
      throw ROW_INDEX_OUT_OF_BOUNDS;

    Type relType = connection.getRegistry().loadRelationType(resultFields.get(0).relationId);

    StringBuilder sb = new StringBuilder();
    sb.append("DELETE FROM ").append(relType.getName()).append(" WHERE CURRENT OF ").append(cursorName);

    long rows = connection.executeForRowsAffected(sb.toString(), true);
    if (rows != 0) {
      if (rowCountCache != null) {
        rowCountCache--;
View Full Code Here

        throw RS_NOT_UPDATABLE;
      }
      updatedRowValues = rowData.clone();
    }

    Type colType = getType(columnIdx);

    Class<?> targetType = SQLTypeUtils.mapSetType(colType);

    val = coerce(val, colType, targetType, typeMap, statement.connection);
View Full Code Here

    Object value = get(columnIndex);
    if (value == null)
      return null;

    Type type = getType(columnIndex);

    if (!(type instanceof ArrayType)) {
      throw SQLTypeUtils.createCoercionException(value.getClass(), Array.class);
    }
View Full Code Here

  public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException {
    checkClosed();
    checkRow();
    checkColumnIndex(columnIndex);

    Type type = getType(columnIndex);

    Class<?> targetType = mapGetType(type, map, statement.connection);

    return coerce(get(columnIndex), type, targetType, map, statement.connection);
  }
View Full Code Here

    Object value = get(parameterIndex);
    if (value == null)
      return null;

    Type type = getOutType(parameterIndex);

    if (!(type instanceof ArrayType)) {
      throw SQLTypeUtils.createCoercionException(value.getClass(), Array.class);
    }
View Full Code Here

  @Override
  public Object getObject(int parameterIndex, Map<String, Class<?>> map) throws SQLException {
    checkClosed();

    Type type = getOutType(parameterIndex);

    Class<?> targetType = mapGetType(type, map, connection);

    return coerce(get(parameterIndex), type, targetType, map, connection);
  }
View Full Code Here

      throw PARAMETER_INDEX_OUT_OF_BOUNDS;
    }

    parameterIdx -= 1;

    Type paramType = parameterTypes.get(parameterIdx);

    if (targetSQLType == Types.ARRAY || targetSQLType == Types.STRUCT || targetSQLType == Types.OTHER) {
      targetSQLType = Types.NULL;
    }
View Full Code Here

TOP

Related Classes of com.impossibl.postgres.types.Type

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.