B4J Question Connecting to CubeSQL DB Server

I have been exploring B4X for the last 2 week seriously although I have been looking since earlier this year.

I think B4X programming tools is really cool and community is amazing!!

Current I am using XOJO to connect the sqlite data file either straight as a single user or transfer the sqlite to the databases folder when it need to be multiuser.

the reason I want to continue using CubeSQL is the ability to move the data from single to multi user by copying the data file either way.

my application currently can be either single or multiple by having a sqlite db named Login.rsd in the same location as the program. if this file does not exist, it look at the app data file and images in the same location as the application. if the login.rsd exist, it will find out what is the location of the images folder and also the IP address of the server and connect to the correct place.

I know I probably need to use jdbc to connect to the cubesql and I probably need a jar for the cubesql which I think does not exist after searching on the forum many times.

So what other way can I use SQLite for multiuser with both read and write??
 

EnriqueGonzalez

Expert
Licensed User
Longtime User
Hi trisha!
If cubeSqL is based on sqlite then is very likely that with the same jdbc driver you can connect both.

Beside that, no you don't need any extra jar, the driver should handle the rest for you if this weren't the case, cubesql may need to provide an sdk but there seems to be none
 
Upvote 0
Upvote 0
While SQLite is a great database, it is not suitable for a case where multiple processes access the same database directly. It will corrupt the database eventually.
I guess that CubeSQL implements a server that serializes the requests. A similar thing can be done quite easily with jRDC2.

do you mean using jRDC2 with sqlite without using cubesql?? I will take a look at the jRDC2 now..
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You can use any Databaseengine which provides a driver with jdrc2 using multiuseraccess.
MySQL, MariaDB, MS SQL.
 
Upvote 0
Do you mean multiple SQLite databases?
yes.. that is what I mean... some of them.. might be just local sqlite db file but some is shared sqlite db file to be access by multiple users.
can the modded jrdc able to handle multiple file.. and where should all the shared db file located???
can all of these go to a databases folder the config for jrdc point to databases folder??
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
how do I access multiple database file???
The simples way is to run one jRDC2 server per database file you want to access. Just use a different port number for each jRDC2 server.
and where should all the shared db file located???
can all of these go to a databases folder the config for jrdc point to databases folder??
You can configure each jRDC2 server as you see fit
 
Upvote 0
The simples way is to run one jRDC2 server per database file you want to access. Just use a different port number for each jRDC2 server.

You can configure each jRDC2 server as you see fit

what should be in the config.properties file???
or where can I get a sample of this file???

what is my application need to access to 2 sqlite data file??
do I need the config.properties in the program folder of my application??
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
what should be in the config.properties file???
or where can I get a sample of this file???

what is my application need to access to 2 sqlite data file??
do I need the config.properties in the program folder of my application??
The config.properties file is located in the Files sub-folder of the project's source. As is, it will become part of the .jar file that is produced (it is static, non-changeable at that point). For an example, see the config.properties file included in the project.
 
Upvote 0
The config.properties file is located in the Files sub-folder of the project's source. As is, it will become part of the .jar file that is produced (it is static, non-changeable at that point). For an example, see the config.properties file included in the project.

thanks for the help.. I will be getting back to you once I start working on this part...
right now, it is just question since I have not start anything on this yet.
 
Upvote 0
Top