Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

Connecting Sahi Pro to MySQL DB

Hello there,

I'm currently trying to connect Sahi to an external database (Mysql 5.7.24) but it seems the jdbc url I typed is not the correct one.
db.driver_name=com.mysql.jdbc.Driver
db.jdbc_url=jdbc:mysql://172.0.0.1/SAHI_LOGS
db.user_name=root
db.password=

172.0.0.1 is the local host, so it should be good, the database name, SAHI_LOGS, is correct as well, the driver is the same as in the docs (https://sahipro.com/alldocs/v6.3.2/using-sahi/storing-reports-in-mysql.html). Yet, when I start sahi.sh, i get an error:
exception: java.sql.SQLException: Connections could not be acquired from the underlying database!
	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:690)
	at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140)
	at net.sf.sahi.plugin.PooledDBClient.getConnection(PooledDBClient.java:31)
	at net.sf.sahi.plugin.DBClient.execute(DBClient.java:66)
	at in.co.sahi.datastore.SahiDB.executeSQL(SahiDB.java:162)
	at in.co.sahi.datastore.SahiDB.createTables(SahiDB.java:98)
	at in.co.sahi.datastore.SahiDB.<clinit>(SahiDB.java:32)
	at net.sf.sahi.f.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
	at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1418)
	at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:606)
	at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:526)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:756)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:683)
	... 8 more

I guessed my url is not the correct, but no solution has been found on internet. Can someone help me regarding this issue? What is the format of the jdbc url I should use?

Comments

  • I investigated a bit, and found an issue with Mysql. I changed the SQL_MODE to accept dates with zeros, thinking it would fix my issue, but it did not. Is someone have an explanation on why I can't connect to my DB?
  • FbacFbac Members
    edited December 2018
    I was meaning 127.0.0.1, obviously, not 172.0.0.1. I tried localhost as well in the url, same issue. I changed the jdbc driver, to try if it would change anything, and unfortunately, no, still having the same error message.
Sign In or Register to comment.