Hi,
I just purchased a cheap VPS. I selected Ubuntu 18.04 and start installing all necessary software from scratch.
I try to deploy my JRDC2 app and it runs on ip address and port 17178. I uploaded the jar file and www (static files/assets) folder using FTP.
Now my question is the config.properties compiled into the jar file?
Is that mean every time I modify the content of this file then I need to recompile the jar?
Yes. It's part of its security. No external accessible config file. You have the source though and can modify it to take an external file and to look for new sql statements
Yes. Please realize, you still have to stop/start the jRDC2 process in order to read any changes in the file. For testing purposes, I just have another server handler (that you can reach via /restart) that I can use to restart the server. Main is rewritten to work with the handler.
Yes. Please realize, you still have to stop/start the jRDC2 process in order to read any changes in the file. For testing purposes, I just have another server handler (that you can reach via /restart) that I can use to restart the server. Main is rewritten to work with the handler.
I would not store important server settings inside the file that related to the RDC server.
I may use the file to store other settings such as mysql and smtp user name and password or values that will be replaced in the html page. The purpose of the file is like config.php in my PHP web api system.
Please realize, you still have to stop/start the jRDC2 process in order to read any changes in the file. For testing purposes, I just have another server handler (that you can reach via /restart) that I can use to restart the server.
Sub Handle(req As ServletRequest, resp As ServletResponse)
Select req.RequestURI
Case "/test/sendemail"
Utility.SendEmail
Case "/test/readini"
Dim m As Map = Utility.ReadMap("appsetting.ini")
Log(m.Get("SMTP_SERVER"))
Case Else
Dim Map1 As Map = CreateMap("result": 1, "message": "success")
resp.ContentType = "application/json"
resp.Write(Utility.Map2Json(Map1))
End Select
End Sub
*Utility is a code module where I put all my reusable functions.
That must be one of your mods. The source of jRDC2 only turns the reloading of the SQL statements on if jRDC2 is ran in Debug mode of the IDE. At least this is how it is in the jRDC2 2.21 source.
I'm leaving the statement above, but it's actually not @DonManfred's mod. It's on the page for jRDC2. Something must have happened along the line, since it is not part of the source distro (nor has it been for a long time, since none of the sources I have have it).
Actually I don't understand how the Debug=true works.
In release mode, we can't modify the settings.
In debug mode, I prefer to stop the execution, modify the sql queries and run debug again.
RDC is a middleware server that makes it simple to safely connect clients and remote SQL database servers. jRDC2 is the latest version. All new projects should use this version. jRDC2 is made of two components: - B4J server. The server receives the requests from the clients, issues the SQL...
Actually I don't understand how the Debug=true works.
In release mode, we can't modify the settings.
In debug mode, I prefer to stop the execution, modify the sql queries and run debug again.
tell me what you have done to help modify JRDC2.
We already did what you are looking for.
and I'll tell you what to modify in JRDC2, to add or edit requests without rebooting
Hi,
I just purchased a cheap VPS. I selected Ubuntu 18.04 and start installing all necessary software from scratch.
I try to deploy my JRDC2 app and it runs on ip address and port 17178. I uploaded the jar file and www (static files/assets) folder using FTP.
Now my question is the config.properties compiled into the jar file?
Is that mean every time I modify the content of this file then I need to recompile the jar?
With this, the config.properties file is available in the applications directory
Private Sub LoadConfigMap As Map File.Copy(File.DirAssets, "config.properties", File.DirApp, "config.properties")
Return File.ReadMap(File.DirApp, "config.properties")
End Sub
Yes, I am also thinking to use a separate file to handle the sql so we do not need to recompile and restart the jrdc server. But this will less secure if "someone" can access my files and modify the sql file.
Maybe another idea is to store the queries in database?
My thought is the following: if I store the query texts into a database table and fetch them as needed, I will avoid the source code changes if something in a query being changed and I will achieve any change without restarting the application!
This library allows you to encrypt or decrypt data using the AES encryption method. It is simple to use and it is compatible with B4A B4XEncryption library and B4i Encryption library (Encrypt and Decrypt method) which means that you can encrypt the data on one platform and decrypt it on a...
Here's a library that, for the moment, can perform Base64 encoding and decoding and symmetric algorithm encryption and decryption. Tested symmetric algorithms are DES, Triple DES and AES (Rijndael). As the Java encryption rountines are all byte array oriented you will need my ByteConverter...
www.b4x.com
Maybe another idea is to store the queries in database?