Description
I tried the following repro. After calling the truncate the Blob object still returns the length as 29 (its original length) .
import java.sql.*;
public class TruncateBugRepro {
Connection con = null;
public Connection getEmbeddedConnection() throws Exception {
if(con == null)
return con;
}
public void testTruncate() throws Exception
{ //String used to getBytes from and insert into Blob. String str = new String("I am a Blob!!! I am a Blob!!!"); Connection con = getEmbeddedConnection(); //create the blob Blob blob = con.createBlob(); //insert bytes blob.setBytes(1,str.getBytes()); //Retuns the Blob length as 29 System.out.println("" + blob.length()); blob.truncate(14); //returns the Blob length as 29 System.out.println("" + blob.length()); }public static void main(String[] args) throws Exception
{ TruncateBugRepro t = new TruncateBugRepro(); t.testTruncate(); }}
Attachments
Attachments
Issue Links
- is related to
-
DERBY-2247 provide set methods for blob in embeded driver
- Closed