B4J Question Problem with jrdc2 and mssqlserver "Error fetching connection

jmorales

Member
Licensed User
Longtime User
Good afternoon everyone, I hope you are doing well. Apologies, the text is translated from Spanish.

I am trying to test the connection to ms-sqlserver with jrdc2 and I am not successful

Steps

1. Change the jar file

'change based on the jdbc jar file
#AdditionalJar: jtds-1.3.1

2. configuracion

#DATABASE CONFIGURATION
DriverClass=net.sourceforge.jtds.jdbc.Driver
JdbcUrl=jdbc:jtds:sqlserver://192.168.1.228/siawin0
User=xxxx
Password=xxxxxx
#Java server port
ServerPort=17180

and the command

sql.test=SELECT top 10 * FROM in04


3. mssqlserver version 2019


4. En b4j show me:


jRDC is running (version = 2.23)


5. In browser


RemoteServer is running (12/24/2023 13:59:51)
Error fetching connection.

I appreciate any help, I can't find what else to change. Merry Christmas.
 

jmorales

Member
Licensed User
Longtime User
The db server is running on the same computer?

If so then try to change the JdbcUrl to: jdbc:jtds:sqlserver://127.0.0.1/siawin0

Hello, thank you very much.

Correct on the same server, I changed it and it gives the same error And in the b4j program this appears

2023-12-25 12:10:46.637:INFO :cmvci.AbstractPoolBackedDataSource:main: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 20000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 1hge19gb018zv87ctwsbwb|2bbf4b8b, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> net.sourceforge.jtds.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hge19gb018zv87ctwsbwb|2bbf4b8b, idleConnectionTestPeriod -> 600, initialPoolSize -> 3, jdbcUrl -> jdbc:jtds:sqlserver://127.0.0.1/siawin0, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 1800, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 150, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {password=******, user=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> true, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]

merry christmas
 
Upvote 0

rhanger

Member
Licensed User
Longtime User
Remove siawin0 from the connection setup after the IP address. I assume you have set up the siawin0 database to listen on the port specified. In that case only include the ip in the connection. The instance name is redundant as the port tells the connection how to get to the db.
There are also a number of security/firewall settings on the PC that can block the connection
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…