B4J Question B4J MS JDBC Connection not possible

morpheus21

New Member
Hello,

i would love to do some future projects using B4J. For this i need to connect to a 2012 Microsoft SQL-Server.
Unfornutaley i cant get it working. Im trying to connect using mssql-jdbc-8.4.1.jre11. Trying and reading posts since days.
Does anyone have a working example for me ? Library JdbcSQL 1.50 is enabled.

B4X:
SQL.Initialize2("com.microsoft.sqlserver.jdbc.SQLServerDriver", "jdbc:sqlserver://192.168.2.65/eazybusiness;Port=1433;databaseName=JTLWAWI", "xxxxxxx", "xxxxxx")

This is my try to connect. Getting "Error connecting to server". I tried jtds-1.3.1 before, and was able to connect. But it did not work as a standalone (Charset problems). So serverside should be fine ?

Thanks in advance !
 

Philip Chatzigeorgiadis

Active Member
Licensed User
Longtime User
Upvote 0

morpheus21

New Member
B4X:
SQL.Initialize("com.microsoft.sqlserver.jdbc.SQLServerDriver","jdbc:sqlserver://192.168.2.65\JTLWAWI;databaseName=eazybusiness;user=xxxxx;password=xxxxx;")

This string did it. Getting a warning because TLS1.1, but works.

Many thanks !
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
This string did it. Getting a warning because TLS1.1
I rarely use MSSQL, but have you tried adding the following line to your connection string.

';sslProtocol=TLSv1.1'
 
Upvote 0
Top