I have a small UI app connected to SQLServer database, which runs fine from the the B4J IDE.
After packing it with B4JPackager 11, I got this error:
Following the suggestion for a similar problem here:
I replaced the JTDS (jtds-1.3.1.jar) driver with MSSQL JDBC driver (mssql-jdbc-8.2.2.jre11.jar) and the problem was fixed.
Is there another solution or workaround, so that I can keep using the JTDS driver?
After packing it with B4JPackager 11, I got this error:
B4X:
D:\ALLDOCS\JAVAPROGRAMS\B4JPackager11\Objects\temp\build\bin>java.exe @release_java_modules.txt -m b4j/b4j.example.main
main._appstart (java line: -1)
java.sql.SQLException: Could not find a Java charset equivalent to DB charset Cp1252.
at b4j/net.sourceforge.jtds.jdbc.JtdsConnection.loadCharset(Unknown Source)
at b4j/net.sourceforge.jtds.jdbc.JtdsConnection.<init>(Unknown Source)
at b4j/net.sourceforge.jtds.jdbc.Driver.connect(Unknown Source)
at java.sql/java.sql.DriverManager.getConnection(Unknown Source)
at java.sql/java.sql.DriverManager.getConnection(Unknown Source)
at b4j/anywheresoftware.b4j.objects.SQL.Initialize2(Unknown Source)
at b4j/anywheresoftware.b4j.objects.SQL.Initialize(Unknown Source)
at b4j/b4j.example.main._appstart(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at b4j/anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
at b4j/anywheresoftware.b4a.BA.raiseEvent(Unknown Source)
at b4j/b4j.example.main.start(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Following the suggestion for a similar problem here:
JTDS Driver: Could not find a Java charset equivalent to collation 2C04D01000
Looking a solution for strange JTDS error message: Could not find a Java charset equivalent to collation 2C04D01000. I tried to pass file.encoding and user.encoding parameters without any success.
stackoverflow.com
I replaced the JTDS (jtds-1.3.1.jar) driver with MSSQL JDBC driver (mssql-jdbc-8.2.2.jre11.jar) and the problem was fixed.
Is there another solution or workaround, so that I can keep using the JTDS driver?