B4J Question jaybird command timeout

uniplan

Active Member
Licensed User
Longtime User
I am using JSQL and jaybird to connect to a firebird db.
I would like to know if there is a way to set the connection timeout and command timeout.

Thanks.

Regards.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

uniplan

Active Member
Licensed User
Longtime User
I recommend you to use ConnectionPool (from the server library). You can configure its timeouts.

Make sure to use InitializeAsync if it is a UI app: https://www.b4x.com/android/forum/threads/sql-connection-and-time-out.42249/

Example of setting a parameter with JavaObject: https://www.b4x.com/android/forum/t...ith-connectionpool-library.42647/#post-261085

List of methods: http://www.mchange.com/projects/c3p0/apidocs/com/mchange/v2/c3p0/AbstractComboPooledDataSource.html

Hi Erel
I have received a lot of information and are a little confused.

My application is NON UI.

What should I use the sql.InitializeAsync or ConnectionPool ?

If I have to use the connectionpool when I have to initialize the connection?

I have seen examples that I've reported.

Sub LoadProject
...
Dim sq As SQL = Main.Pool.GetConnecton
'execute async query
sq.ExecQueryAsync("LoadProject", s, Null)

End Sub

Sub LoadProject_QueryComplete (Success As Boolean, Crsr As ResultSet)
Dim sq As SQL = Sender
if success then
do while crsr.nextrow
'loop through the results
loop
crsr.close
end if
sq.Close 'return the connection to the pool
End Sub

but I could not find where to initialize the connection.

Thanks.
 
Upvote 0
Top