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

Status
Not open for further replies.

DonManfred

Expert
Licensed User
Longtime User
See #1 for description and sample.
I think it should be something like this
B4X:
Select * from table where field like '?%'

B4X:
Dim cmd As DBCommand
cmd.Initialize
cmd.Name = "select_with_like"
cmd.Parameters = Array As Object("searchvalue")
reqManager.ExecuteQuery(cmd, 0, "Tag")
 

Anser

Well-Known Member
Licensed User
Longtime User

See the below given link
https://www.b4x.com/android/forum/t...necting-to-mysql-using-rdc.49518/#post-309914

You need to add/append the '%' character along with the parameter data and then pass it to RDC. For eg '%Your Search Value' OR '%Your Search Value%'
 

veranio79

Member
Licensed User
Longtime User
Hi all,
i'm trying to setup this connector un my win 2012 server with MSSQL server 2008r2.

Here is my RDC's config:

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://VSERVER/GPSDB
User=test
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 = ?

This is my driver:
B4X:
jtds-1.3.1.jar

launch 'RunRLC.bat' then call ther server in the browser and the browser response is:
B4X:
RemoteServer is running (Wed Oct 28 11:40:18 CET 2015)
java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.

Obviously, the user and pass for my SQL server are right, i can use them to connect from other apps like visual studio...

Can anyone help me with this issue?
Thanks in advance
 

Attachments

  • upload_2015-10-28_11-51-28.png
    12.1 KB · Views: 389

veranio79

Member
Licensed User
Longtime User
VSERVER is the hostname of my server with MSSQL. i've tryed with the IP instead, but same response.
Thanks
 

veranio79

Member
Licensed User
Longtime User
Yes i'm using the default port, the firewall is down and MSSQL accept external connection. But the RDC and MSSQL are running on the same server (VSERVER)
 

vbmundo

Well-Known Member
Licensed User
Hi, What can I use in one APP to connect Android with remote MySQL Database WITHOUT Java web server ?

My App ask to the user for her credentials and then connect to this server.

Regards
 

killiak

Member
Licensed User
Longtime User
Hi, What can I use in one APP to connect Android with remote MySQL Database WITHOUT Java web server ?

My App ask to the user for her credentials and then connect to this server.

Regards

Pablo, "tocayo"
3 possible ways

1- RDC (jRDC or RDC same thing)
Pros: Fast, Easy and once you handle config.properties really easy to scale it
Cons: Java in the server, need to have the possibility to run in there

2- PHP "middleware" communication between you app and the Mysql Database
Pros: Easy PHP programming. Communication in no time with just a few lines. You can use a Web DB without permissions because is just like a Web
Cons: SLooooooow when you hit heavy DB. sometimes it hangs (happen to me a lot) so you need to control those Hangs (clientes are impatients). You need a good skill PHP+Mysql to avoid SQL injection.

3- Don Manfred "Cheapest ever" middleware (the link above)
Pros: Feels like ADO VB6 Stuff. really easy to use. And quite fast actually
Cons: The credentials to get into the DB are pretty easy to obtain, so you have to consider using this in a close system. I don't recommend it for Web applications

I don't know other
If you want the spanish version of this, PM. I'm from Argentina

Pablo Guevara
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…