0

Using MySQL workbench I can connect to the cluster db without any issue. but when I use it as the connection string jdbc:mysql:loadbalance://node_ip1,node_ip2,node_ip3/cluster_db_name?loadBalanceBlacklistTimeout=5000&loadBalanceStrategy=bestResponseTime from the app it will give me an error saying connection timeout. After that I use one cluster node and try to connect to it as we connect to localhost jdbc:mysql://cluster_node1/cluster_db_name?relaxAutoCommit=true&autoReconnect=true&useUnicode=true&connectionCollation=utf8_general_ci&characterEncoding=utf8&characterSetResults=utf8 but it also gives me the same error.

Below is the applicationContext.xml code.

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
    <property name="driverClass" value="${bluesky.jdbc.driver}"/>
    <property name="jdbcUrl" value="${bluesky.jdbc.url}"/>
    <property name="user" value="${bluesky.jdbc.username}"/>
    <property name="password" value="${bluesky.jdbc.password}"/>
    <property name="minPoolSize" value="${bluesky.c3p0.pool.min.size}"/>
    <property name="maxPoolSize" value="${bluesky.c3p0.pool.max.size}"/>
    <property name="numHelperThreads" value="${bluesky.c3p0.numHelperThreads}"/>
    <property name="acquireIncrement" value="${bluesky.c3p0.acquireIncrement}"/>
    <property name="acquireRetryAttempts" value="${bluesky.c3p0.acquireRetryAttempts}"/>
    <property name="idleConnectionTestPeriod" value="${bluesky.c3p0.idleConnectionTestPeriod}"/>
    <property name="maxIdleTime" value="${bluesky.c3p0.maxIdleTime}"/>
    <property name="preferredTestQuery" value="${bluesky.c3p0.preferred.test.query}"/>
    <property name="testConnectionOnCheckout" value="${bluesky.c3p0.test.connection.on.checkout}"/>
    <property name="testConnectionOnCheckin" value="${bluesky.c3p0.test.connection.on.checkin}"/>
    <property name="checkoutTimeout" value="${bluesky.c3p0.checkout.timeout}"/>
    <property name="debugUnreturnedConnectionStackTraces" value="${bluesky.c3p0.debug.unreturned.connection.stackTraces}"/>
    <property name="unreturnedConnectionTimeout" value="${bluesky.c3p0.unreturned.connection.timeout}"/>
</bean>

Visit here to Error description

M. Deinum
  • 115,695
  • 22
  • 220
  • 224
Rozane
  • 63
  • 1
  • 4
  • Please read http://stackoverflow.com/help/how-to-ask and improve your question with that knowledge. For starters post code and exceptions as code not as screenshots (those become too small to read). – M. Deinum Nov 21 '16 at 07:46
  • @M.Deinum - I tried to add exception but it didn't show like in the formatted way. That's why I did add as an image. if you click, it will show you clear view – Rozane Nov 21 '16 at 09:22
  • Use the correct tags to show code. People willing to help don't want to click images/links to get a full overview of your issue. – M. Deinum Nov 21 '16 at 09:30

0 Answers0