When running your JVM language application just put the JDBC har in
classpath and define java.library.path to point to directory with sqlitejdbc.EXE.
On Sat, 11 Jan 2025 17:24:52 -0500, Arne Vajhøj wrote:
When running your JVM language application just put the JDBC har in
classpath and define java.library.path to point to directory with
sqlitejdbc.EXE.
Isn’t there a more direct way yet, to access the world’s most popular DBMS from Java?
<https://developer.android.com/reference/android/database/sqlite/package-summary>
Most Java code use the JDBC API or an
ORM on top of JDBC. Android additionally offers an Android
specific API.
This is a little HOWTO.
1) Get latest SQLite for VMS from https://sourceforge.net/projects/vms- ports/files/SQLITE3/
(currently sqlite3_vms_051.zip)
2) Build with 64 bit pointers using MMS:
$ mms/macro=(pointer_opt=64)
3) Get latest SQLite JDBC driver from https://github.com/xerial/sqlite-jdbc
(currently sqlite-3.47.2.0.jar)
4) Get latest NativeDB.c from https://github.com/xerial/sqlite-jdbc/ tree/master/src/main/java/org/sqlite/core
5) Generate JNI shareable image using COM file below.
$ jcc := cc/pointer=64/name=(as_is,shortened)/reent=multi/float=ieee/ ieee=denorm/include=(sys$common:[openjdk$80.include],sys$common :[openjdk$80.include.openvms],sqlite3_include)"
$ javah -cp sqlite-jdbc-3_47_2_0.jar org.sqlite.core.NativeDB
$ ren org_sqlite_core_NativeDB.h NativeDB.h
$ jcc NativeDB
$ pipe java$build_option NativeDB.obj > NativeDB.opt
$ link/map/share=sqlitejdbc NativeDB + NativeDB/opt + sys$input/opt sqlite3shr64/share
$
$ exit
When running your JVM language application just put
the JDBC har in classpath and define java.library.path to
point to directory with sqlitejdbc.EXE
.
Example:
$ javac Demo.java
$ java -cp .:sqlite-jdbc-3_47_2_0.jar -Djava.library.path=. Demo
On 1/11/2025 5:24 PM, Arne Vajhøj wrote:
This is a little HOWTO.
1) Get latest SQLite for VMS from https://sourceforge.net/projects/
vms- ports/files/SQLITE3/
(currently sqlite3_vms_051.zip)
2) Build with 64 bit pointers using MMS:
$ mms/macro=(pointer_opt=64)
3) Get latest SQLite JDBC driver from https://github.com/xerial/
sqlite-jdbc
(currently sqlite-3.47.2.0.jar)
4) Get latest NativeDB.c from https://github.com/xerial/sqlite-jdbc/
tree/master/src/main/java/org/sqlite/core
5) Generate JNI shareable image using COM file below.
$ jcc := cc/pointer=64/name=(as_is,shortened)/reent=multi/float=ieee/
ieee=denorm/include=(sys$common:[openjdk$80.include],sys$common
:[openjdk$80.include.openvms],sqlite3_include)"
$ javah -cp sqlite-jdbc-3_47_2_0.jar org.sqlite.core.NativeDB
$ ren org_sqlite_core_NativeDB.h NativeDB.h
$ jcc NativeDB
$ pipe java$build_option NativeDB.obj > NativeDB.opt
$ link/map/share=sqlitejdbc NativeDB + NativeDB/opt + sys$input/opt
sqlite3shr64/share
$
$ exit
When running your JVM language application just put
the JDBC har in classpath and define java.library.path to
point to directory with sqlitejdbc.EXE
And have a logical sqlitejdbc pointing to sqlitejdbc.EXE
On 1/11/2025 10:46 PM, Arne Vajhøj wrote:
On 1/11/2025 5:24 PM, Arne Vajhøj wrote:
This is a little HOWTO.
1) Get latest SQLite for VMS from https://sourceforge.net/projects/
vms- ports/files/SQLITE3/
(currently sqlite3_vms_051.zip)
2) Build with 64 bit pointers using MMS:
$ mms/macro=(pointer_opt=64)
3) Get latest SQLite JDBC driver from https://github.com/xerial/
sqlite-jdbc
(currently sqlite-3.47.2.0.jar)
4) Get latest NativeDB.c from https://github.com/xerial/sqlite-jdbc/
tree/master/src/main/java/org/sqlite/core
5) Generate JNI shareable image using COM file below.
$ jcc := cc/pointer=64/name=(as_is,shortened)/reent=multi/float=ieee/
ieee=denorm/include=(sys$common:[openjdk$80.include],sys$common
:[openjdk$80.include.openvms],sqlite3_include)"
$ javah -cp sqlite-jdbc-3_47_2_0.jar org.sqlite.core.NativeDB
$ ren org_sqlite_core_NativeDB.h NativeDB.h
$ jcc NativeDB
$ pipe java$build_option NativeDB.obj > NativeDB.opt
$ link/map/share=sqlitejdbc NativeDB + NativeDB/opt + sys$input/opt
sqlite3shr64/share
$
$ exit
When running your JVM language application just put
the JDBC har in classpath and define java.library.path to
point to directory with sqlitejdbc.EXE
And have a logical sqlitejdbc pointing to sqlitejdbc.EXE
It is "or" not "and". Either the logical or the define.
But the logical is preferable as the define can be tricky
with other JVM languages.
And for those that prefer JPA and JPQL over JDBC and SQL,
then out of the box Hibernate 5.6 and the SQLite dialect from https://mvnrepository.com/artifact/com.github.gwenn/sqlite-dialect
works fine.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 437 |
Nodes: | 16 (2 / 14) |
Uptime: | 192:45:35 |
Calls: | 9,135 |
Calls today: | 2 |
Files: | 13,432 |
Messages: | 6,035,344 |