Android Tutorial Tutorial of connecting Android to MS SQL Server using jRDC2

Hi

Here is a tutorial that shows the steps of how to make an Android connection to MS SQL Server using jRDC2.

Download tutorial here:
Attached the Mobile Project in B4A and the JRDC2 Project in B4J

Any questions please ask in the forum

Bladimir Silva Toro
Teacher programming software
 

Attachments

  • Example B4A.zip
    10.4 KB · Views: 1,808
  • jRDC SQL Server.zip
    5.2 KB · Views: 1,674
  • Script TestSQLServer.txt
    857 bytes · Views: 1,541

pengbm

Member
Licensed User
Longtime User
Where's your MS SQL database? In another computer in your network? In the same computer you're developing? In internet?
Hello, I would like to know if I rent a cloud database, shall I change the part of localhost to the external IP address of the cloud database: port? However, when I run the url < cloud database IP address >:17178/test, the browser always prompts me to time out……
 

josejad

Expert
Licensed User
Longtime User
Hello, I would like to know
Hi:

You should create a new thread for your question.

if I rent a cloud database
jRDC2 needs to be run on a VPS (virtual server). If you run in the same server as your database (faster and more secure), then config.properties must point to localserver. If they are in differents servers (jRDC2 in server A and database in server B) then it has to point the the external ip of the database.
Your database server must have opened the ports to access to database, so you should probably take additional security measures, like such as restricting port access to the ip of the jRDC2 server)
 

pengbm

Member
Licensed User
Longtime User
你好:

您应该为您的问题创建一个新话题。


jRDC2需要在VPS(虚拟服务器)上运行。如果在与数据库相同的服务器中运行(更快、更安全),则 config.properties 必须指向 localserver。如果它们位于不同的服务器中(服务器 A 中的 jRDC2 和服务器 B 中的数据库),则它必须指向数据库的外部 ip。
数据库服务器必须已打开端口才能访问数据库,因此您应该采取其他安全措施,例如限制对 jRDC2 服务器的 ip 的端口访问)
 

pengbm

Member
Licensed User
Longtime User
Thanks for your reply. They are indeed in different servers, and I also pointed to the external IP of the database, the port of the database should be open, because I can connect to my cloud database using Navicat, but I can't connect to my cloud database using JRDC, I don't know what the problem is.

So I want to ask you if my format is correct:

http://XXX (database external IP) : 17178 (this Java server port number does not change?) /test
 

Bladimir Silva Toro

Active Member
Licensed User
Longtime User
Thanks for your reply. They are indeed in different servers, and I also pointed to the external IP of the database, the port of the database should be open, because I can connect to my cloud database using Navicat, but I can't connect to my cloud database using JRDC, I don't know what the problem is.

So I want to ask you if my format is correct:

http://XXX (database external IP) : 17178 (this Java server port number does not change?) /test
Hello @pengbm

jRDC2 is a millware that runs on Java.

So to make it work there are several possibilities which are:

1. Local Service: Both your database and jRDC2 run locally on your PC or on your LAN or WIFI network. It is possible to convert your PC or your local server into a remote one, for that you must ask your ISP (Internet Service Provider) for a public internet IP.

2. Remote Service: You can have jRDC2 and your database running on a VPS service, there are several that I like such as DigitalOcean, Google Cloud and VPS Mart.

Remember that in a VPS service they give you a virtual server with only the operating system in linux or Windows, you must install everything else, that is, the database, the JRE, the FTP and run jRDC2.

Shared hosting services like Hostinger, GoDaddy, Hostgator, Wix and others are NOT working as it cannot run Java applications like jRDC2

My recommendation and surely that of many colleagues is that you use jRDC2 in a VPS service, I personally recommend DigitalOcean since you can start from 5 dollars a month. https://www.digitalocean.com/

If you have a shared hosting I recommend that you make your own WebServices and consume it in B4A.

Any other questions will be gladly answered
 
Last edited:

Shelby

Well-Known Member
Licensed User
This is a very old thread and topic. I think you better start a new thread/question series.
 

amarnath

Member
Licensed User
Longtime User
I tried a lot but I can't get it. I want to connect in b4a. I have OviPanel. In that I have to connect to Mysql database. Can anyone help me?
 

josejad

Expert
Licensed User
Longtime User
I have OviPanel. In that I have to connect to Mysql database
Please, start a new thread, you're asking in a thread about how to connect to MS SQL, but you want to know about Mysql. We don't know what's OviPanel, but it seems to be a control panel, so you can't use a jRDC2 server.

So, start a new thread, explain us how are you trying to connect to your database, where is it hosted, etc...
If you don't have ssh access to your server, you probably have to access using PHP (or another server side languaje) or JdbcSQL
 
Last edited:
Top