Android Question Connecting remotely to local database in a pc using real android device(B4A-bridge).

Ayabonga

Member
Hello guys,

I am trying to connect remotely to a database using a real android device. I have followed the steps in JRDC2 tutorial but now I cannot retrieve data from the database(phymyadmin) when my app is running from the android device. Please check the attached screenshot.
 

Attachments

  • error.PNG
    error.PNG
    89 KB · Views: 201

OliverA

Expert
Licensed User
Longtime User
Do you have more than one instance of MySQL running on the PC? The default port for MySQL is 3306, yet PHPMyAdmin is connected to 3308. Since you left out the port number in your JDBC URL, the jRDC2 server should be connecting to a MySQL database running on port 3306, not 3308.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Do you have more than one instance of MySQL running on the PC? The default port for MySQL is 3306, yet PHPMyAdmin is connected to 3308. Since you left out the port number in your JDBC URL, the jRDC2 server should be connecting to a MySQL database running on port 3306, not 3308.
I also notice a different port number.

Try edit the config.properties to:
B4X:
#DATABASE CONFIGURATION
DriverClass=com.mysql.jdbc.Driver
JdbcUrl=jdbc:mysql://localhost:3308/example?characterEncoding=utf8
 
Upvote 0

Ayabonga

Member
Hello Guys,

Thank you all for the support. I have tried what you guys suggested and at last, it works fine, I can now connect to my local database and read data.
I am not sure what was the exact issue but I will share what I did.

I followed the steps on this link https://www.b4x.com/android/forum/threads/db-mysql-with-jrdc2.93302/#post-590325
I added the port 3308 on the config properties as suggested : JdbcUrl=jdbc:mysql://localhost:3308/example?characterEncoding=utf8
I then noticed I didn't have java installed on my laptop so I installed it.

Again thanks for the support guys, much appreciated.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
Nice that your connectivity problem is solved. Next time you run in connectivity problems you can use a freeware program like PuTTY and make a (remote) TELNET connection to the supposed port on the IP address. If you send a CR or any other character to the remote server. If you receive anything including garbage, from the remote site, Then you know that the connectivity is ok.
 
Upvote 0
Top