B4J Library jRDC Hikari mix

When using the jRDC server project in the project, I had to use another server to handle other things. I wrote a different version of jRDC under myself. Now everyone can use it and modify it under themselves.

Used materials:
Thanks to all of them.
1. jRDC - basic library https://www.b4x.com/android/forum/t...-rdc-remote-database-connector.61801/#content @Erel
2.HikariCp - very fast connection with the base https://www.b4x.com/android/forum/threads/hikaricp-high-performance-connection-pool.88430/#content @mindful
3. DBM - query handling module from ABMAterial https://www.b4x.com/android/forum/threads/abmaterial-framework-for-webapps.60072/#content @alwaysbusy

'.sql. changed on the '.met' (method).

'Securekey' has been added to authorize the function:
'ref' - overloading server methods from the configuration file
'add' - adding method and reloading
'rem' - method removal and reloading
Now the server does not have to be restarted to read the 'met.' Again. Can manage 'met.' on an online server without reboot.

Features have been added:
single - returns the result of the query of one value in the form of 'string'
call - calls the given function in a given module, you can send ServletResponse, ServletRequest if the last parameter is 'true'
exec - starting a separate process on the server, at the end of 'true' it is passing parameters, eg running backup, calculations, etc.
kill - kill the process on the server

B4X:
#Lines starting with '#' are comments.
#Backslash character at the end of line means that the command continues in the next line.
#DATABASE CONFIGURATION

DriverClass=com.mysql.jdbc.Driver
JdbcUrl=jdbc:mysql://server:3306/namedatabase?characterEncoding=utf8
User=
Password=

#Java server
ServerPort=17178


#example of MS SQL Server configuration:
#DriverClass=net.sourceforge.jtds.jdbc.Driver
#JdbcUrl=jdbc:jtds:sqlserver://<server address>/<database>
#example of postegres configuration:
#JdbcUrl=jdbc:postgresql://localhost/test
#DriverClass=org.postgresql.Driver

#secure key
securekey=password

#examples
# localhost:17178/ref?key=password                                                   - reload method from config.properties
# localhost:17178/add?key=password&method=met.user=select * from user                  - adding a new method without a parameter
# localhost:17178/add?key=password&method=met.user2=select * from user where idx=?     - adding a new method with a parameter
# localhost:17178/rem?key=password&method=met.user                                    - deletion of the 'user' method
# localhost:17178/rdc?method=ownerplan
# localhost:17178/rdc?method=login&value=miki,passw11
# localhost:17178/rdc?method=other&value=one,two,tree
# localhost:17178/rdc?method=other
# localhost:17178/rdc?method=exec1&value=simple_arg
# localhost:17178/rdc?method=kill


#select, insert, update, delete at the beginning of the method executes the sql query
#'single' before 'select' query sql query and return one value

#'call' method performing functions in a given module.
#the 'call' method 'true' as the last parameter overrides 'ServletResponse' and 'ServletRequest' to the function.
#'ServletResponse' will be in front of the last argument list, 'ServletRequest' on the last argument position
#the 'call' and 'false' methods, like the last argument, start the function without passing 'ServletResponse' and 'ServletRequest' from the given module. The server returns the 'OK' response

#the 'exec' method starts a separate process in the system, 'true' passes parameters from 'value' as a list, 'false' without passing (uncertain)
#the 'kill' method kills the process with the given name in the system (uncertain)

#method

met.ownerplan=select * from v_ownerplan
met.login=select * from user where name=? and password=?
met.idxuser:select idx from user where name=?
met.ownerplan2=select * from v_ownerplan where idxplan=?
met.adduserplan=insert into user_plan (idx_plan, idx_user) values (? ,?)
met.checkuserplan=select * from user_plan where idx_plan=? and idx_user=?
met.userplan=select * from v_userplan where idxuser=?
met.getplan= select odleglosc, count_point from plan where idx=?
met.postpoint= insert intp user_point (aa, bbb,x,y,cc) values(?,?,?,?,?)
met.pass2=single select password from user where name=?
met.pass=single select password from user where name='buc'
met.other=call utils,test,true
met.other2=call utils,test2,false
met.exec1=exec another.jar,false
met.exec2=exec another.exe,true
met.kill=kill notepad++.exe

The result from sql select is in the form LIST with MAP ('column name', 'value')
Library is needed in the 'Library' directory.
In the 'Client' directory, an example usage module in B4J, B4A, B4i with examples.
In the 'Files' directory, a sample configuration file 'config.properties'
Additional explanations are provided in the 'config.properties' file.

Link to the package because it does not fit on the server.
https://drive.google.com/file/d/1rVGmQ9jSqT2miTMj6PlIJW4EP-u8bt7a/view?usp=sharing

Sorry for my English.
 

MichalK73

Active Member
Licensed User
I also use HikariCP in the ABMaterial project. With some extended nested 'select' I can see a difference of about 30% -70% to the usual mysql connection. Server on the same machine. I also noticed increased performance when connecting a Hikari jRDC to a remote server.
 

Alexander Stolte

Expert
Licensed User
thanks, I've looked at the library, really good work! I will use it soon for my server. Especially for the live operation, it is good that you now have more options.

this lib is a must have if: jRDC2 goes pro :cool:
 
Top