private void setPGobject(int parameterIndex, PGobject x) throws SQLException { String typename = x.getType(); int oid = connection.getTypeInfo().getPGType(typename); if (oid == Oid.UNSPECIFIED) throw new PSQLException(GT.tr("Unknown type {0}.", typename), PSQLState.INVALID_PARAMETER_TYPE); setString(parameterIndex, x.getValue(), oid); }
private void setPGobject(int parameterIndex, PGobject x) throws SQLException { String typename = x.getType(); int oid = connection.getTypeInfo().getPGType(typename); if (oid == Oid.UNSPECIFIED) { throw new PSQLException(GT.tr("Unknown type {0}.", typename), PSQLState.INVALID_PARAMETER_TYPE); } if ((x instanceof PGBinaryObject) && connection.binaryTransferSend(oid)) { PGBinaryObject binObj = (PGBinaryObject) x; byte[] data = new byte[binObj.lengthInBytes()]; binObj.toBytes(data, 0); bindBytes(parameterIndex, data, oid); } else { setString(parameterIndex, x.getValue(), oid); } }
object = null; } else { if (pgObject.getType().equals("jsonb")) { object = JsonHelper.read(pgObject.getValue()); } else {
private static String getPgDataType(Object v) { if (v instanceof java.sql.Timestamp) { return "timestamp"; } if (v instanceof java.util.Date) { return "date"; } if (havePGobject && v instanceof PGobject) { return ((PGobject)v).getType(); } return null; }
if (obj instanceof PGobject) { PGobject pg = (PGobject) obj; if (pg.getType().equalsIgnoreCase("json")) { JsonNode pgNode; try { pgNode = DataFileTool.OBJECT_MAPPER.readTree(pg.getValue()); node.set(columnNameToUse, pgNode); } catch (IOException e) { LOGGER.error("An exception occurred while attempting to parse JSON PGObject to JsonNode: {}", obj, e); node.put(columnNameToUse, obj.toString()); } } else { node.put(columnNameToUse, obj.toString()); } }
public static NodeValue _makeNodeValue(PGobject o) { String type = o.getType(); if(type.equals("geography") || type.equals("geometry")) { try { PGgeometry geom = new PGgeometry(o.getValue()); return new NodeValueGeom(geom); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { throw new NotImplementedException(); } return null; } }
public FixedPGobject(org.postgresql.util.PGobject o) { super(); setType(o.getType()); try { setValue(o.getValue()); } catch (SQLException e) { throw new RuntimeException(e); } }
private void setPGobject(int parameterIndex, PGobject x) throws SQLException { String typename = x.getType(); int oid = connection.getTypeInfo().getPGType(typename); if (oid == Oid.UNSPECIFIED) throw new PSQLException(GT.tr("Unknown type {0}.", typename), PSQLState.INVALID_PARAMETER_TYPE); setString(parameterIndex, x.getValue(), oid); }
private void setPGobject(int parameterIndex, PGobject x) throws SQLException { String typename = x.getType(); int oid = connection.getTypeInfo().getPGType(typename); if (oid == Oid.UNSPECIFIED) throw new PSQLException(GT.tr("Unknown type {0}.", typename), PSQLState.INVALID_PARAMETER_TYPE); setString(parameterIndex, x.getValue(), oid); }
if ((obj instanceof PGobject) && ((PGobject) obj).getType().equals("record")) { final PGobject pgObj = (PGobject) obj; final DbFunction function = DbFunctionRegister.getFunction(name, pgSet.getStatement().getConnection()); } else if (obj instanceof PGobject) { final PGobject pgObj = (PGobject) obj; node = new ObjectResultNode(pgObj.getValue(), name, pgObj.getType(), typeId, pgSet.getStatement().getConnection()); } else if (obj instanceof PgArray) {