Search in sources :

Example 1 with JDBCBlobFile

use of org.hsqldb.jdbc.JDBCBlobFile in project rxjava2-jdbc by davidmoten.

the class DatabaseTest method testUpdateBlobWithBlob.

@Test
public void testUpdateBlobWithBlob() throws SQLException {
    try (Database db = db()) {
        Blob blob = new JDBCBlobFile(new File("src/test/resources/big.txt"));
        insertPersonBlob(db);
        // 
        db.update(// 
        "update person_blob set document = :doc").parameter("doc", // 
        blob).counts().test().awaitDone(TIMEOUT_SECONDS, // 
        TimeUnit.SECONDS).assertValue(// 
        1).assertComplete();
    }
}
Also used : Blob(java.sql.Blob) JDBCBlobFile(org.hsqldb.jdbc.JDBCBlobFile) JDBCBlobFile(org.hsqldb.jdbc.JDBCBlobFile) JDBCClobFile(org.hsqldb.jdbc.JDBCClobFile) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)1 Blob (java.sql.Blob)1 JDBCBlobFile (org.hsqldb.jdbc.JDBCBlobFile)1 JDBCClobFile (org.hsqldb.jdbc.JDBCClobFile)1 Test (org.junit.Test)1