Android Question Help with RDC

imgsimonebiliato

Well-Known Member
Licensed User
Hello,
so I need to connect and doing some sql interrogation to my MySQL server.

I follow this tutorial for to configure RDC, but when I try to access (with http://127.0.0.1:17178/?method=test) the server I get this error:

B4X:
RemoteServer is running (Thu Apr 02 21:54:47 CEST 2015)
java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
I copied to the jdbc_driver folder, a jar file named: "com.mysql.jdbc_5.1.5"
And this is the config.properties file:


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
User=db_user
Password=my_password
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 = ?

Please, how can solve? I need to install "Connect/j"?
How can I connect directly to my database?
Is RDC necessary in my application? If yes, how can I import it?
 
Last edited:

imgsimonebiliato

Well-Known Member
Licensed User
Is this database local? You also may want to ping the server and check your connection stability.
Hi, I followed the tutorial. I think that it si a general database for tests. Isn't it? In that case, what params I must modify to connect to my MySql remote database?


The file should be "mysql-connector-java-5.1.30-bin.jar"
Get it from HERE Eumel
Hi, your link if for version 5.1.35. Where I can find the correct jar file?
 

Eumel

Active Member
Licensed User
5.1.35 is also ok.

The RDC Server and your MySQL Database Server should run on the same pc.

-----
Eumel
 

imgsimonebiliato

Well-Known Member
Licensed User
My final intent is to execute queries from a remote database.
If I use RDC is a good way right? So, please, what I have to change, to connect to my personal database?

Please help
 

imgsimonebiliato

Well-Known Member
Licensed User
If it's only this, I can't understand how to use
 

Eumel

Active Member
Licensed User
The jdbcUrl is localhost.

As i said in post 5: RDC server and MySQL Database Server should run on same pc.
 

giga

Well-Known Member
Licensed User
My final intent is to execute queries from a remote database.
If I use RDC is a good way right? So, please, what I have to change, to connect to my personal database?

Please help
"My final intent is to execute queries from a remote database". First make sure you can see it from the inside then check your port 17178 on the router to see if you can get it from the outside.

This is correct locally:
B4X:
DriverClass=com.mysql.jdbc.Driver
JdbcUrl=jdbc:mysql://localhost/test?characterEncoding=utf8
User=db_user
Password=my_password
ServerPort=17178
Instead of localhost you could also try the actual IP example : 192.168.1.100
 
Top