Package java.sql

Examples of java.sql.Clob.truncate()


        this.rs = utf8Conn.createStatement().executeQuery(
            "SELECT `text` FROM testBug11614 WHERE id=1");
        assertTrue(this.rs.next());

        Clob c = this.rs.getClob(1);
        c.truncate(0);
        int blockSize = 8192;
        int sizeToTest = blockSize + 100;

        StringBuffer blockBuf = new StringBuffer(sizeToTest);
View Full Code Here


    this.rs = this.stmt.executeQuery("SELECT * FROM testClobTruncate");
    this.rs.next();

    Clob clob = this.rs.getClob(1);
    clob.truncate(3);

    Reader reader = clob.getCharacterStream();
    char[] buf = new char[8];
    int charsRead = reader.read(buf);

View Full Code Here

      this.rs = this.stmt.executeQuery("SELECT * FROM testClobTruncate");
      this.rs.next();

      Clob clob = this.rs.getClob(1);
      clob.truncate(3);

      Reader reader = clob.getCharacterStream();
      char[] buf = new char[8];
      int charsRead = reader.read(buf);

View Full Code Here

        utf8Conn.createStatement().executeUpdate("INSERT INTO testBug11614  (`id`,`text`) values (1,'')");
        this.rs = utf8Conn.createStatement().executeQuery("SELECT `text` FROM testBug11614 WHERE id=1");
        assertTrue(this.rs.next());
       
        Clob c = this.rs.getClob(1);
        c.truncate(0);
        int blockSize = 8192;
        int sizeToTest = blockSize + 100;
       
        StringBuffer blockBuf = new StringBuffer(sizeToTest);
       
View Full Code Here

    this.rs = this.stmt.executeQuery("SELECT * FROM testClobTruncate");
    this.rs.next();

    Clob clob = this.rs.getClob(1);
    clob.truncate(3);

    Reader reader = clob.getCharacterStream();
    char[] buf = new char[8];
    int charsRead = reader.read(buf);

View Full Code Here

        this.rs = utf8Conn.createStatement().executeQuery(
            "SELECT `text` FROM testBug11614 WHERE id=1");
        assertTrue(this.rs.next());

        Clob c = this.rs.getClob(1);
        c.truncate(0);
        int blockSize = 8192;
        int sizeToTest = blockSize + 100;

        StringBuffer blockBuf = new StringBuffer(sizeToTest);
View Full Code Here

                "select dClob, length from largeClobs where id = 8");
        ResultSet rs = ps.executeQuery();
        while (rs.next()) {
            Clob clob = rs.getClob(1);
            int length = rs.getInt(2);
            clob.truncate(length -1);
        }
    }

    /**
     * Runs a test using multiple threads.
View Full Code Here

    assertTrue(rs.next());
    Clob clob = rs.getClob("DATA");

    assertEquals(100, clob.length());

    clob.truncate(50);
    assertEquals(50, clob.length());

    clob.truncate(150);
    assertEquals(150, clob.length());
View Full Code Here

    assertEquals(100, clob.length());

    clob.truncate(50);
    assertEquals(50, clob.length());

    clob.truncate(150);
    assertEquals(150, clob.length());

    data = clob.getSubString(1, 200);
    assertEquals(150, data.length());
    for (char i = 0; i < 50; i++) {
View Full Code Here

                "select dClob, length from largeClobs where id = 8");
        ResultSet rs = ps.executeQuery();
        while (rs.next()) {
            Clob clob = rs.getClob(1);
            int length = rs.getInt(2);
            clob.truncate(length -1);
        }
    }

    /**
     * Runs a test using multiple threads.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.