Hi,
As said in the title, I am using jdbcSQL to connect to a MySQL server ver 8.0.30
I understand that the app is not connecting to the server. The problem appeared after upgrading and moving to a new MySQL server ver 8.0.30 on a different server. Earlier this was working fine.
Please note that I am able to connect to this same database from my other desktop application using the same username and password without any change. It is a remote Database. It is failing ONLY in B4A.
On the Logs, it is written "Check unfiltered logs for JDBC errors". When I checked the unfiltered logs I found the following error message
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server
Somewhere in this forum, I read that a few of our members faced similar issues and that the problem is only in release mode and that it works fine in debug mode. Erel has already provided a solution for Disabling Strict mode. I have also used the code to disable Strict Mode using the already available code on this forum. For me, it is not working in debug mode and release mode.
I am already aware that jRDC2 is the best way, but for now, I have to make this app up and running as early as possible. Hence any hint to resolve this issue would be appreciated
I am using B4A version 11.50
The same problem is there in another B4A app of mine, which is connecting to a different database, but residing on the same server. This app does not use jdbcSQl instead it uses the library from DonManfred. I know it is not recommended to use this library anymore. It is an app written in the year 2017 and all these years it worked fine until I moved to a different server and upgraded the MySQL version to 8.0.3
I am not sure whether it is impossible to connect to MySQL ver 8.0.3 directly from Android phones nowadays
Regards
Anser
As said in the title, I am using jdbcSQL to connect to a MySQL server ver 8.0.30
I understand that the app is not connecting to the server. The problem appeared after upgrading and moving to a new MySQL server ver 8.0.30 on a different server. Earlier this was working fine.
Please note that I am able to connect to this same database from my other desktop application using the same username and password without any change. It is a remote Database. It is failing ONLY in B4A.
On the Logs, it is written "Check unfiltered logs for JDBC errors". When I checked the unfiltered logs I found the following error message
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server
Somewhere in this forum, I read that a few of our members faced similar issues and that the problem is only in release mode and that it works fine in debug mode. Erel has already provided a solution for Disabling Strict mode. I have also used the code to disable Strict Mode using the already available code on this forum. For me, it is not working in debug mode and release mode.
B4X:
Sub DisableStrictMode
Dim jo As JavaObject
jo.InitializeStatic("android.os.Build.VERSION")
If jo.GetField("SDK_INT") > 9 Then
Dim policy As JavaObject
policy = policy.InitializeNewInstance("android.os.StrictMode.ThreadPolicy.Builder", Null)
policy = policy.RunMethodJO("permitAll", Null).RunMethodJO("build", Null)
Dim sm As JavaObject
sm.InitializeStatic("android.os.StrictMode").RunMethod("setThreadPolicy", Array(policy))
End If
End Sub
I am already aware that jRDC2 is the best way, but for now, I have to make this app up and running as early as possible. Hence any hint to resolve this issue would be appreciated
I am using B4A version 11.50
The same problem is there in another B4A app of mine, which is connecting to a different database, but residing on the same server. This app does not use jdbcSQl instead it uses the library from DonManfred. I know it is not recommended to use this library anymore. It is an app written in the year 2017 and all these years it worked fine until I moved to a different server and upgraded the MySQL version to 8.0.3
I am not sure whether it is impossible to connect to MySQL ver 8.0.3 directly from Android phones nowadays
Regards
Anser
Last edited: