I was trying to convert a blob to string with the following code:
ResultSet rs = stmt.executeQuery(query);
Blob newValueBLOB = rs.getBlob("NEW_VALUE");
System.out.println(newValueBLOB);
String newValue = new String(newValueBLOB.getBytes(0, (int) newValueBLOB.length()));
My database is Oracle and the connection is established properly. I've found a similar answer but mine is not working!