I am trying to connect to an AceQL server using JDBC.
I downloaded the jdbc driver jar from here:
I placed the jar in the configured additional libraries folder.
I created a default B4XPages B4A project, added the JdbcSQL library, and added the line to Main:
I edited the B4XMainPage code:
When I run the project and click on the button, I get this error:
1. I am guessing that "jdbc:aceql:" is the correct string to use.
2. I am guessing that "com.aceql.jdbc.driver.free.AceQLDriver" is the proper driverclass to use.
Question 1 : How do I determine what goes after "jdbc:" I know its "mysql" for MySql, but where does that come from?
Question 2: Does the JDBC driver aceql-http-client-jdbc-driver-all-9.1.jar work with B4A? Are there any specific requirements?
Question 3: How do I solve the error posted above?
Notes:
I am just getting started experimenting with this, I managed to set up and configure properly the AceQL server on my Windows dev machine and it seems to be working fine.
Properly displays a response:
Home - AceQL
AceQL HTTP lets you connect to your remote or Cloud SQL databases with SQL from any device (mobile, tablet, PC, etc.)
www.aceql.com
I downloaded the jdbc driver jar from here:
Download - AceQL
Version 12.3 - June 15, 2024.The Windows, Linux/Unix & macOS installers cover both the Basic, Professional & Enterprise Plans.
www.aceql.com
I placed the jar in the configured additional libraries folder.
I created a default B4XPages B4A project, added the JdbcSQL library, and added the line to Main:
B4X:
#AdditionalJar: aceql-http-client-jdbc-driver-all-9.1
I edited the B4XMainPage code:
B4X:
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private jdbc As JdbcSQL
End Sub
Private Sub Button1_Click
'http://192.168.1.3:9090/aceql/database/alal/username/testuser/login?password=testuser
Private driverclass As String = "com.aceql.jdbc.driver.free.AceQLDriver"
Private jdbcurl As String
Private url As String = "http://192.168.1.3:9090/aceql"
Private username As String = "testuser"
Private password As String = "testuser"
Private database As String = "alal"
jdbcurl = "jdbc:aceql:" & url & "/" & database
jdbc.Initialize2(driverclass, jdbcurl, username, password)
End Sub
When I run the project and click on the button, I get this error:
B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
b4xmainpage_button1_click (java line: 66)
java.sql.SQLException: No suitable driver found for jdbc:aceql://http://192.168.1.3:9090/aceql/alal
at java.sql.DriverManager.getConnection(DriverManager.java:605)
at java.sql.DriverManager.getConnection(DriverManager.java:218)
at anywheresoftware.b4j.objects.SQL.Initialize2(SQL.java:56)
at b4a.example.b4xmainpage._button1_click(b4xmainpage.java:66)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7448)
at android.view.View.performClickInternal(View.java:7425)
at android.view.View.access$3600(View.java:810)
at android.view.View$PerformClick.run(View.java:28305)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
1. I am guessing that "jdbc:aceql:" is the correct string to use.
2. I am guessing that "com.aceql.jdbc.driver.free.AceQLDriver" is the proper driverclass to use.
Question 1 : How do I determine what goes after "jdbc:" I know its "mysql" for MySql, but where does that come from?
Question 2: Does the JDBC driver aceql-http-client-jdbc-driver-all-9.1.jar work with B4A? Are there any specific requirements?
Question 3: How do I solve the error posted above?
Notes:
I am just getting started experimenting with this, I managed to set up and configure properly the AceQL server on my Windows dev machine and it seems to be working fine.
Properly displays a response:
{ "status": "OK", "connection_id": "919108734", "session_id": "roe49rhb6x6biu3h8bzqhr0sfw" }
Attachments
Last edited: