Java: Clob to byte[]

Victor picture Victor · Feb 24, 2011 · Viewed 16.8k times · Source

How can I read a java.sql.Clob into a byte[]?

Answer

A.Alexander picture A.Alexander · Feb 25, 2011

with commons-io

byte[] data = IOUtils.toByteArray(clob.getAsciiStream());