I am not sure, from where i can get the support!
So, I am trying to use SymmetricDS with HSQLDb and MySQL. I am trying to run hsqldb as Server mode from Java codding, I am not sure, how can I add the classpath of symmetric-client-3.15.7.jar when running hsqldb, as it's not picking up by simpley running!
I alreday hava added symmetricds dependencies in my build.gradle file.
HsqlProperties p1 = new HsqlProperties();
p1.setProperty("server.database.0", "mem:hsqldb");
p1.setProperty("server.dbname.0", "minicogs");
p1.setProperty("server.port", "9001");
p1.setProperty("server.remote_open", "true");
server1 = new Server();
server1.setProperties(p1);
server1.setLogWriter(null);
server1.setErrWriter(null);
server1.start();
in cmd, i can simpley run
java -cp"lib/hsqldb-2.5.1.jar;web/WEB-INF/lib/symmetric-client-3.15.7.jar" org.hsqldb.Server --address %SERVER_ADDRESS% --port %SERVER_PORT% --database.0 "%DB_PATH%;%DB_ENCRYPT%;user=%DB_USER%;password=%DB_PASSWORD%" --dbname.0 %DB_NAME%
but not sure, how can i set classpath when trying to run HSQLdb server through my java code!
then problem is that when i try to run this function, I am facing the error:
CREATE FUNCTION sym_base_64_encode(binaryData BINARY)
RETURNS VARCHAR(1000000)
NO SQL
LANGUAGE JAVA PARAMETER STYLE JAVA
EXTERNAL NAME > 'CLASSPATH:org.jumpmind.symmetric.db.hsqldb.HsqlDbFunctions.encodeBase64';
SQL Error [42501]: user lacks privilege or object not found: org.jumpmind.symmetric.db.hsqldb.HsqlDbFunctions
You need to tell HSQLDB that it is OK to use the HsqlDBFunctions class from symmertic. You do this by adding a -D switch to the java command.
See the Guide: http://hsqldb.org/doc/2.0/guide/sqlroutines-chapt.html#src_jrt_access_control
Please also use the latest version of HSQLDB.
@fredt thanks for your quick reply! Your porvided solutions works like a charm!
I like HSQLdb super community support!
Last edit: Abid Maqbool 2024-06-23