B4J Question [SOLVED] JRDC2 Error

makis_best

Well-Known Member
Licensed User
Longtime User
Hi

I try to access my MSSQL Server with RDC2 and I get the above error.
Any help?

HTTP ERROR 500
Problem accessing /rdc. Reason:

com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@3724b2bb -- timeout at awaitAvailable()

In the config.properties I have:
#DATABASE CONFIGURATION
DriverClass=mssql-jdbc-8.2.2.jre11.jar
JdbcUrl=jdbc:jtds:sqlserver://192.168.1.2;databaseName=XXXXX;user=sa;password=XXXXX;

#Java server port
ServerPort=17178
 

OliverA

Expert
Licensed User
Longtime User
Upvote 0

makis_best

Well-Known Member
Licensed User
Longtime User
I am trying from yesterday to make it work but I can't.
I don't know why.
But with jtds-1.3.1.jar I make it run.
 
Upvote 0

Revisable5987

Member
Licensed User
Have you tried removing 'jtds:', its not in the example shown in the link posted by @OliverA?

Connect to the default database on the local computer by using a user name and password:

jdbc:sqlserver://localhost;user=MyUserName;password=*****;

so something like:
JdbcUrl=jdbc:sqlserver://192.168.1.2;databaseName=XXXXX;user=sa;password=XXXXX;
 
Upvote 0

Revisable5987

Member
Licensed User
So I've looked into it a bit more:
https://docs.microsoft.com/en-us/sq...c-driver-for-sql-server?view=sql-server-ver15
https://docs.microsoft.com/en-us/sq...tanding-java-ee-support?view=sql-server-ver15

1. The driver class name is com.microsoft.sqlserver.jdbc.SQLServerDriver not mssql-jdbc-8.2.2.jre11.jar

2.When you download the driver, there are multiple JAR files. The name of the JAR file indicates the version of Java that it supports.
#AdditionalJar:mssql-jdbc-8.2.2.jre11 would mean Java 11

3. make sure you have
#AdditionalJar:mssql-jdbc-8.2.2.jre11
in your b4j project
and the jar file in your b4j additional libraries folder
 
Last edited:
Upvote 0

OliverA

Expert
Licensed User
Longtime User
I don't know if my Java version mater. I use Java 8
Yes , use the Java 8 version. There are several versions in the zip/msi file of the driver download file
 
Upvote 0

makis_best

Well-Known Member
Licensed User
Longtime User
So I've looked into it a bit more:
https://docs.microsoft.com/en-us/sq...c-driver-for-sql-server?view=sql-server-ver15
https://docs.microsoft.com/en-us/sq...tanding-java-ee-support?view=sql-server-ver15

1. The driver class name is com.microsoft.sqlserver.jdbc.SQLServerDriver not mssql-jdbc-8.2.2.jre11.jar

2.When you download the driver, there are multiple JAR files. The name of the JAR file indicates the version of Java that it supports.
#AdditionalJar:mssql-jdbc-8.2.2.jre11 would mean Java 11

3. make sure you have in your b4j project
and the jar file in your b4j additional libraries folder

I confused... The Driver class name on config.properties file must be com.microsoft.sqlserver.jdbc.SQLServerDriver???
and inside B4J must be like #AdditionalJar: mssql-jdbc-8.2.2.jre8
 
Upvote 0

makis_best

Well-Known Member
Licensed User
Longtime User
OK.... I make it work

1) In my additional library folder i insert the file mssql-jdbc-8.2.2.jre8.jar cuz I am using Java8
2) In JRDC2 main module I add #AdditionalJar: mssql-jdbc-8.2.2.jre8.jar
3) In the config.properties I add
DriverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
JdbcUrl=jdbc:sqlserver://192.168.1.2;databaseName=xxxxxxxx;
User=xxxxxxx
Password=xxxxxxx

And it works like a charm....

Thank you all for your help.
 
Upvote 0
Top