B4J Question jRDC2

David Hawkins

Active Member
Licensed User
Longtime User
Hi guys, I need some help, I have been trying to get a connection to an MS SQL database and I keep getting the following error: -

java.sql.SQLException: Unknown server host name '127.0.0.1\SQLEXPRESS'.

My config.properties file has the following: -

#DATABASE CONFIGURATION
DriverClass=net.sourceforge.jtds.jdbc.Driver
JdbcUrl=jdbc:jtds:sqlserver://127.0.0.1\\SQLEXPRESS
databaseName=supreme
User=sa
Password=xxxxxx
#Java server port
ServerPort=17178
#SQL COMMANDS
sql.select_all=SELECT datearrived FROM swmain

I have included #AdditionalJar: jtds-1.3.1.jar

otherwise I am using the same code as on the web site. I just can't figure out what is going wrong.

Regards
 

marcick

Well-Known Member
Licensed User
Longtime User
not sure but I would try with

B4X:
JdbcUrl=jdbc:jtds:sqlserver://localhost/SQLEXPRESS/supreme
 
Upvote 0

David Hawkins

Active Member
Licensed User
Longtime User
Hi guys

Thank you for your help. I have resolved the issue which was in the end nothing to do with B4J it was a misconfigured SQL Server which is now working as it should.

Regards
 
Upvote 0
Top