Android Question JDBC server timeout.

David Elkington

Active Member
Licensed User
Longtime User
Hi,

I was wondering anyone could help. I am trying to get a JDBC server working, the server runs but it times out when connecting to the db.. I have SQL server 2012 express running as an instance (QUINGOCRM) and created a database on the SQL server. I installed my config file as such....

JdbcUrl=jdbc:jtds:sqlserver://192.168.0.11/QUINGOCRM/riskassessment
User=database
Password=database0407
ServerPort=17178

The server runs, but I get timeout when running http://127.0.0.1:17178/?method=test in chrome

java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.

I have tried all sorts of changes to the database etc but that does not help, I installed jtds, and turned the windows firewall off.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Are you using the old RDC 1? You should use jRDC2: https://www.b4x.com/android/forum/threads/61801/#content

Based on the error, RDC cannot connect to the database. Is the database hosted on the same computer? If not then you should make sure that the firewall allows incoming connection on the SQL Server default port.
 
Upvote 0

David Elkington

Active Member
Licensed User
Longtime User
Hi Erel,

Yes, the SQL Server is on the same machine, it is a VM on a Mac at the moment, but I am buying a PC to run it off. I will try updating to the second version, but I am not sure that will help if I can't get past the stage of connecting to a database. Do you think it could be the JDBC driver? I have downloaded the version from Microsoft and the tdbc shown in your tutorial, however I think the instance may be throwing things off?
 
Upvote 0

David Elkington

Active Member
Licensed User
Longtime User
Hi Erel,

the VM is running on 192.168.0.11 and I am running windows 10 with SQL server 2012.

I have tried to use the MS jdbc driver as below in the config.properties

#SQL Server
DriverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
JdbcUrl=jdbc:sqlserver://localhost/QUINGOCRM:1433;databaseName=riskassessment;user=database;password=database0407;
User=database
Password=database0407
ServerPort=17178

The file in the jdbc_driver directory is now sqljdbc4.jar as opposed to the jets-1.3.1.jar I was using before.
 
Upvote 0

David Elkington

Active Member
Licensed User
Longtime User
Yes, I disabled that. If I use the jts driver, should my config file be like this to get to a database on instance QUINGOCRM called riskassessment?

DriverClass=net.sourceforge.jtds.jdbc.Driver
JdbcUrl=jdbc:jtds:sqlserver://localhost/QUINGOCRM/riskassessment
User=database
Password=database0407
ServerPort=17178

When I do a netstat -a however, I cannot see 1433 as being listened to, I can see a UDP [: :] : 1434 however and I know the SQL server is running as I can connect to another database running on it using MS Access. Most confused.
 
Upvote 0

David Elkington

Active Member
Licensed User
Longtime User
Im running RDC in the VM, I have attached what my window shows.
Screen Shot 2017-01-08 at 08.48.24.png
Screen Shot 2017-01-08 at 08.48.40.png
Screen Shot 2017-01-08 at 08.48.40.png
 
Upvote 0

David Elkington

Active Member
Licensed User
Longtime User
That was painful, it was an issue with the SQL Server, the browser service was tied to another instance and the QUINGOCRM instance was not listening on 1433. I uninstalled SQL entirely and reinstalled and now it it is working.
 
Upvote 0
Top