error in PgResultSet#getBlob(int)
See original GitHub issueIt seems org.postgresql.jdbc.PgResultSet#getBlob(int) is wrong in version group: 'org.postgresql', name: 'postgresql', version: '42.1.1'
IDE shows me its code as:
public Blob getBlob(int i) throws SQLException {
checkResultSet(i);
if (wasNullFlag) {
return null;
}
return makeBlob(getLong(i));
}
and I think there should not be makeBlob(getLong(i));
but makeBlob(getColumnOID(i));
cause makeBlob
wants oid
as only param, and getLong
seems to return Long
value of that column and not an oid
I’m getting an error here:
Exception in thread "main" org.postgresql.util.PSQLException: Bad value for type long : \xabcd
at org.postgresql.jdbc.PgResultSet.toLong(PgResultSet.java:2860)
at org.postgresql.jdbc.PgResultSet.getLong(PgResultSet.java:2114)
at org.postgresql.jdbc.PgResultSet.getBlob(PgResultSet.java:418)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
ResultSet.getClob() causing problems when used with JPA's ...
To: pgsql-jdbc(at)postgresql(dot)org. Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob. Date: 2016-07-27 19:19:52.
Read more >ResultSet.getClob() causing problems when used with JPA's ...
Hi. I have a varchar-column in a table which maps to a field (of type String) in a JPA-entity. When marking that String-property...
Read more >ResultSet.getBlob() Exception - oracle - Stack Overflow
The SQL developer workbench by default converts longtext to CLOB (make sense to me) but the code was expecting Blob. I guess the...
Read more >SQL error messages and exceptions - Oracle Help Center
ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row. X0X95, Operation ' <operationName> ' ...
Read more >PostgreSQL 7.3, Blob, and OID - Hibernate Forums
PG 7.3 and the corresponding JDBC driver appears to support ResultSet.getBlob and PreparedStatement.setBlob with OID columns.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@guai https://www.postgresql.org/docs/9.6/static/largeobjects.html
Have never used them myself.
Searching Google with: “jdbc getblob postgresql” gets you to previous discussions on this question. In short, blob/clob points to PostgreSQL’s “Large Object” system. bytea and text types are accessed via getBytes and getString respectively.