DuckDB - anyone tried ?

I made a first test using JDBC.

B4X: Copy
'Non-UI application (console / server application)
#Region Project Attributes
    #CommandLineArgs:
    #MergeLibraries: True
    #AdditionalJar: duckdb_jdbc-1.0.0
#End Region

Sub Process_Globals
    Private SQL As SQL
End Sub

Sub AppStart (Args() As String)
    Example
    StartMessageLoop
End Sub

Sub Example
    Try
        SQL.Initialize("org.duckdb.DuckDBDriver", "jdbc:duckdb:")
        Dim rs As ResultSet = SQL.ExecQuery("SELECT current_timestamp")
        Do While rs.NextRow
            Log(rs.GetString2(0))
        Loop
    Catch
        Log(LastException)
    End Try
End Sub

Note:
duckdb_jdbc-1.0.0.jar is 63.2MB
sqlite-jdbc is around 12.8MB

Release jar of the above example = 63MB took 45 seconds to compile on my machine.
Similar jar using SQLite in-memory = 12MB took 6 seconds to compile.
 

Attachments

Last edited:
Works !
1721470954295.png


p.s. Compiled .jar is indeed 63 MB ! (sic!)
 
Last edited:
Under Android JDBC example:
Caused by: java.lang.IllegalStateException: Unsupported system architecture

So, curious by online-requests, but huge and non-universal for B4X.
 

Attachments

Last edited:
Back
Top