Trying to use MySQL for the first time, migrating from SQLite.
And sometimes i get errors like
or
DB is used locally - B4J server app is running at the same host with DB (Private DBLocation As String = "localhost").
Is it normal situation ?
DB connection is so:
Tried all 3 versions, each works, and all with rare errors of this kind...
Why these errors ? Is it disconnect from DB ?
p.s. file-based SQLite has big advantage for this moment - no any deny during work...
And sometimes i get errors like
from MariaDB JDBC connector:
java.lang.RuntimeException: java.sql.SQLNonTransientConnectionException: (conn=1805) execute() is called on closed connection
from MySQL JDBC connector:
java.lang.RuntimeException: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
DB is used locally - B4J server app is running at the same host with DB (Private DBLocation As String = "localhost").
Is it normal situation ?
DB connection is so:
B4X:
'#AdditionalJar: mysql-connector-java-5.1.49
'#AdditionalJar: mysql-connector-java-8.0.23
#AdditionalJar: mariadb-java-client-2.7.1.jar
' SQL.Initialize2("com.mysql.jdbc.Driver", $"jdbc:mysql://${DBLocation}/${DBname}?allowPublicKeyRetrieval=false&autoReconnect=true&connectTimeout=8000&socketTimeout=8000&maxIdleTime=600&requireSSL=false&useSSL=false&pooling=true"$, DBUsername, DBPassword)
' SQL.Initialize2("com.mysql.cj.jdbc.Driver", $"jdbc:mysql://${DBLocation}/${DBname}?allowPublicKeyRetrieval=false&autoReconnect=true&connectTimeout=5000&socketTimeout=5000&maxIdleTime=300&requireSSL=false&useSSL=false&pooling=false"$, DBUsername, DBPassword)
SQL.Initialize2("org.mariadb.jdbc.Driver", $"jdbc:mariadb://${DBLocation}/${DBname}?allowPublicKeyRetrieval=false&autoReconnect=true&connectTimeout=5000&socketTimeout=5000&maxIdleTime=300&requireSSL=false&useSSL=false&pooling=false"$, DBUsername, DBPassword)
Tried all 3 versions, each works, and all with rare errors of this kind...
Why these errors ? Is it disconnect from DB ?
p.s. file-based SQLite has big advantage for this moment - no any deny during work...
Last edited: