I am not very familar whit connection pool. I just want to know if my understand is good. So, I copy a class module server handler.
Is it a correct approach for connection pool?
I have many class module server handler. Is it good for these class?
web server B4J:
'Handler class
Sub Class_Globals
Private mysql1 As SQL
Private Pool1 As ConnectionPool
End Sub
Public Sub Initialize
Pool1.Initialize("com.mysql.cj.jdbc.Driver","jdbc:mysql://localhost:3308/rappeltravail?characterEncoding=utf8&useTimezone=true&serverTimezone=America/New_York","user","password")
mysql1=Pool1.GetConnection
End Sub
Sub Handle(req As ServletRequest, resp As ServletResponse)
' do something
' acces to database
'send result to servletRasponse by resp
'job done, close the pool
Pool1.ClosePool
End Sub
Is it a correct approach for connection pool?
I have many class module server handler. Is it good for these class?