Android Question java.io.EOFException when using remote database connector

Luc Van erom

Member
Licensed User
Longtime User
Hi,

I installed the remote database connector following the instructions given in the RDC tutorial. I need it for a SQL Server connection, so I used the jtds-1.3.1.jar.jar driver which I placed in the right folder as instructed.
I entered the right (at least according the documentation and samples) database connection string in the config file which looks like this:
#DriverClass=com.mysql.jdbc.Driver
#JdbcUrl=jdbc:mysql://localhost/test?characterEncoding=utf8
#SQL Server
DriverClass=net.sourceforge.jtds.jdbc.Driver
JdbcUrl=jtds:sqlserver://localhost:1433/thewall;tds=8.0

User=me
Password=mine
ServerPort=1433
#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.select_all=SELECT * FROM thewall.dbo.Comments

After running the runRLC.bat file I see exactly the the same response in the command screen shown in the tutorial. For me it looks if I have the server running :)
However when running http://localhost:1433/?method=Test through a browser I get a 'java.io.EOFException' error in the browser screen. :(Also a dump of the same error followed by a list of file names in command screen.
After looking for all kind reasons/solutions in the internet, I cannot find the answer.

Do you have suggestions how to fix this issue?

Needles to mention that I'm a newbie I guess, but hey you have to start somewhere:D

Luc
 

Luc Van erom

Member
Licensed User
Longtime User
Right, that helped. Thanks Erel with a capital E :)

I switched to the SQL Server jdbc driver from MS since the sourceforge version didn't work with my SQLEXPRESS version. (Error message was that the driver was not correct)

Now I'm stuck with the following error
RemoteServer is running (Thu Sep 19 21:57:37 CEST 2013)
java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.

More details from the cmd screen:
Last acquisition attempt exception: com.microsoft.sqlserver.jdbc.SQLServerException: The port number 1433/THEWALL is not valid.

The config file now looks as:
#SQL Server
DriverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
JdbcUrl=jdbc:sqlserver://localhost:1433/THEWALL
User=LUC
Password=***
ServerPort=1433
#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.select_all=SELECT * FROM thewall.dbo.comments

I have enabled the TCP/IP protocal in the SQL Server configuration manager and set the port number to 1433 for my local IP address, but it doesn't help.

Any clues how to proceed here?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You are confusing ServerPort with the database port. There are two servers running. RDC and SQL Server. The Android app connects to RDC. RDC connects to the database.

Set ServerPort to 17178 (or any port you like). It must be different than the database port. The link (in the browser / app) should use the ServerPort not the database port.
 
Upvote 0

Luc Van erom

Member
Licensed User
Longtime User
Erel, if changed the server port to 17178 but I still get exactly the same timeout and exception
RemoteServer is running (Fri Sep 20 19:38:15 CEST 2013)
java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.

More details from the cmd screen:
Last acquisition attempt exception: com.microsoft.sqlserver.jdbc.SQLServerException: The port number 17178/THEWALL is not valid.

I found discussions about the need to put the file 'sqljdbc_auth.dll' somewhere in the application path, but that's for java apps. Is this also relevant when using RDC?

Any other suggestions to get this problem solved?
 
Upvote 0

Luc Van erom

Member
Licensed User
Longtime User
My config file now looks like this:

#DriverClass=com.mysql.jdbc.Driver
#JdbcUrl=jdbc:mysql://localhost/test?characterEncoding=utf8
#SQL Server
DriverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
JdbcUrl=jdbc:sqlserver://localhost:17178/thewall
User=LUC
Password=lve
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.select_all=SELECT * FROM thewall.dbo.comments
 
Upvote 0

Luc Van erom

Member
Licensed User
Longtime User
Ok I get it. However it still was not working after setting the port numbers right.

Plowing on, I found some tips about the connection string on the internet. I changed the url string from

JdbcUrl=jdbc:sqlserver://localhost:1433/thewall

to

JdbcUrl=jdbc:sqlserver://localhost:1433;databasename=thewall

and then finally the server is running and successfully makes a connection.:p
 
Upvote 0
Top