Android Question how to connect to mysql database

rogel a. tolentino

Member
Licensed User
I already connected an android phone via vpn at the server.
The ip address of the server is 192.168.0.5
The schema name is casureco2 and i want to display the output of
"select * from area" where area is one of the table of casureco2
can you provide me sample code
 

José J. Aguilar

Expert
Licensed User
Yes, just configure the jRDC2 server to access 192.168.0.5 and the android app to access jRDC2 ip in
rdcLink.

Remember, jRDC2 is middleware, your app must access the jRDC2, and jRDC2 must access to mysql.
 
Upvote 0

rogel a. tolentino

Member
Licensed User
B4X:
#Lines starting with '#' are comments.
#Backslash character at the end of line means that the command continues in the next line.

#DATABASE CONFIGURATION
DriverClass=com.mysql.jdbc.Driver
#JdbcUrl=jdbc:mysql://localhost/test?characterEncoding=utf8
JdbcUrl=jdbc:mysql://192.168.0.5/casureco2?characterEncoding=utf8
User=root
Password=1
#Java server port
ServerPort=17178
The above code is the content of config.properties

192.168.0.5 is the ip address of mysql server
192.168.0.13 is the ip address of jrdc2 server

when i test the connection by typing localhost:17178/test or 192.168.0.13:17178/test both has message

RemoteServer is running (11/20/2018 07:26:32)
Connection successful.

but when i test the connection by typing 192.168.0.5:17178/test the message is unable to connect

What is wrong?
 
Last edited:
Upvote 0

José J. Aguilar

Expert
Licensed User
192.168.0.5:17178/test is not working because there is no jRDC2 server there! Why do you need it works?
Now you have to set up your android app to access 192.168.0.13
 
Upvote 0
Top