You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello-
I am trying to connect to Oracle DB using Spring c3p0 java. Without TLS properties, am able to connect successfully.
AWS RDS Oracle DB has TLS enabled on different port, When i connect using TLS port from Spring with SSL Truststore properties added, am getting error.. I developed simple java code using jdbc & tried adding SSL truststore properties & able to connect..
Could you please advise on this whether the SSL properties will work with c3p0 ??
Error:
"org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
Code:
ComboPooledDataSource dataSource = new ComboPooledDataSource(false);
dataSource.setDataSourceName(name);
dataSource.setIdentityToken(tokenname);
dataSource.setDriverClass(driverClass);
dataSource.setJdbcUrl(jdbcUrl);
dataSource.setUser(user);
dataSource.setPassword(password);
dataSource.setInitialPoolSize(initialPoolSize);
dataSource.setMinPoolSize(initialPoolSize);
dataSource.setMaxPoolSize(maxPoolSize);
Properties props = new Properties();
props.setProperty("javax.net.ssl.trustStore", "/var/certs/test.jks");
props.setProperty("javax.net.ssl.trustStoreType", "JKS");
props.setProperty("javax.net.ssl.trustStorePassword", "****"); // Masked
// Set the properties to datasource
if (maxIdleTime > 0)
dataSource.setMaxIdleTime(maxIdleTime);
if (idleConnectionTestPeriod > 0)
dataSource.setIdleConnectionTestPeriod(idleConnectionTestPeriod);
if (preferredTestQuery != null)
dataSource.setPreferredTestQuery(preferredTestQuery);
if (connectionCustomizerClassName != null)
dataSource.setConnectionCustomizerClassName(connectionCustomizerClassName);
if (checkoutTimeout != null)
dataSource.setCheckoutTimeout((int) checkoutTimeout.toMillis());
C3P0Registry.reregister(dataSource);
The text was updated successfully, but these errors were encountered:
Hello-
I am trying to connect to Oracle DB using Spring c3p0 java. Without TLS properties, am able to connect successfully.
AWS RDS Oracle DB has TLS enabled on different port, When i connect using TLS port from Spring with SSL Truststore properties added, am getting error.. I developed simple java code using jdbc & tried adding SSL truststore properties & able to connect..
Could you please advise on this whether the SSL properties will work with c3p0 ??
Error:
"org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
Code:
The text was updated successfully, but these errors were encountered: