B4J Question Database Questions

dw_b4x

Member
Patience is requested. I am a new user I am looking at the B4X development environment. I have a couple of questions that I would like to ask before I get started. I have to admit one of the nice 'features' is the large amount of activity on the forum.

What is the best way to get put data changes to a database. Obviously we don't want to post every field to the database ; only the fields that have changed. Using previous programming environments I utilized a control tag; And set the tag as changed when the user change the edit field; the tag also contained the field name so I could build my SQL Queries quickly. Is this a example of looping through all the controls.

I want to utilize JRDC2 to act as a middle man between my software and the database. By looping through then controls I should be able to build the JRDC2 parameters easily. Is there any limits regarding parameter length ??

Images - I have heard pluses and minuses regarding putting pictures into the database. Obviously one would need to convert to base64 to insert the image into the database. I assume this could be done through JRDC2 without any issues. The other path is putting the image in a folder on the server. Is there an example of how this would be done ?

I was also thinking about utilizing CloudKVS to act as a replication tool to synch location. This would also provide a log of all database activities . My thought pattern is the software would create the JRCD2 command and submit it the the local server and the JRDC2 parameters would be posted to CloudKVS so the remote location could would receive them and then post them to the remote server.

Any thoughts or suggestions are greatly appreciated.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Is there any limits regarding parameter length ??
No limits.

Obviously one would need to convert to base64 to insert the image into the database.
Wrong. Use blobs directly. Faster and smaller.

I assume this could be done through JRDC2 without any issues
True.
The other path is putting the image in a folder on the server. Is there an example of how this would be done ?
Not too difficult to implement after you become familiar with jServer.

I recommend you to start with jRDC2, especially if you only need to synchronize a field or two. CloudKVS solves a more complicated case.
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User

Another one: If the images are big (let's say more than 50 KB) then store them to the filesystem. In the db store a link to the file. Benefits: Small database and easier and faster to backup.
 
Upvote 0

dw_b4x

Member
Thanks for the prompt answers.

Most of my images (they are signatures) are small so I think storing them in the database is a workable solution.

Question. Blob to database through JRDC2. (ie Parameter).
How would that be done ??
Could you provide a code snippet to show saving/retrieving a blob through JRDC2
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…