Android Tutorial Remote Database Connector (RDC) - Connect to any remote DB

Status
Not open for further replies.

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'm assuming the table 'animals' should be created in my MS SQL Server database by the java server's config.properties, but it doesn't get created.
No, the config file doesn't create any table.

You can call the create_table statement with ExecuteCommand to create the table.

Though this is just an example.
 

crawler

Member
Licensed User
Longtime User
Thank you Erel.

To further handle my confusion, what is the purpose for listing these commands in config.properties?
Can sql commands (optionally) be executed from the config file instead of the RDC client?
 

driesvp

Member
Licensed User
Longtime User
Erel, I'm sorry. What I mean: now the database connection is made with a separate java applet but could this be integrated in B4J?
 

bl4ck4nt

Member
Licensed User
Longtime User
how to wait for the process to finish before the next process...? due process to the second query has to do with the query to first
exp: SELECT SUM TABLE PostgreSQL -> SELECT TABLE LIMIT ? OFFSET ? PostgreSQL -> INSERT TABLE SQLite
 

bl4ck4nt

Member
Licensed User
Longtime User
thank you Erel,
I just have a problem, when the data transfer using PostgreSQL rdc to always error on the data type uuid / guid ...? because the RDC issued a varchar data type (string), I want to add on WriteObject(o As Object, out As OutputStream) and ReadObject(In As InputStream) As Object a data type UUID / GUID just do not know the type of data in B4A what ...?tx
I also want to add a timestamp without time zone data type.
 
Last edited:

SpinBower

Member
Licensed User
Longtime User
This means that RDC wasn't able to connect to the server. Can you post the contents of config.properties?

B4X:
#Lines starting with '#' are comments.
#Backslash character at the end of line means that the command continues in the next line.
DriverClass=com.mysql.jdbc.Driver
JdbcUrl=jdbc:mysql://localhost/test?characterEncoding=utf8

#SQL Server
#DriverClass=net.sourceforge.jtds.jdbc.Driver
#JdbcUrl=jdbc:jtds:sqlserver://<database server ip>/<database>
User=user
Password=pass
ServerPort=17178
#If Debug is true then this file will be reloaded on every query.
#This is useful if you need to modify the queries.
Debug=true

#commands
sql.create_table=CREATE TABLE animals (\
    id INT NOT NULL AUTO_INCREMENT,\
    name CHAR(30) NOT NULL,\
    image BLOB,\
    PRIMARY KEY (id))
sql.insert_animal=INSERT INTO animals VALUES (null, ?,?)
sql.select_animal=SELECT name, image FROM animals WHERE name = ?

My database server is on the website lostmode.com
Where do I enter that?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…