I'm trying to place a ~4MB LargeObject into a bytea type with the
jdbc7.2dev driver but am receiving an OutOfMemory error.
Exception in thread "main" java.lang.OutOfMemoryError:
at java.lang.StringBuffer.expandCapacity(StringBuffer.java:202)
at java.lang.StringBuffer.append(StringBuffer.java:496)
at org.postgresql.util.PGbytea.toPGString(PGbytea.java:83)
at org.postgresql.jdbc2.PreparedStatement.setBytes(PreparedStatement.java:320)
at org.postgresql.jdbc2.PreparedStatement.setBinaryStream(PreparedStatement.java:577)
at BlobTest.store(BlobTest.java:39)
at BlobTest.main(BlobTest.java:90)
Is there any way to deal with this?
Thanks.