Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

MySOL Connection Issue

Avatar

Level 6

Dear Team,

I have come across below issue:

 

AEM version : 6.5.0

MySQL Version : 8.0.20

 

I have done my MySQL schema connection successfully using "Day Common JDBC Connections Pool " as below :

arvind_0-1588767347102.png

 

and when I execute my JSP code below , i get "Connection done" message.

JSP Code:

 

<%
DataSourcePool dspService = sling.getService(DataSourcePool.class);
try {
DataSource ds = (DataSource) dspService.getDataSource("aemform");
if(ds != null) {
%><p>Obtained the datasource!</p><%
%><%
out.println("Trying to get connection Connection done");
final Connection connection = ds.getConnection();
out.println("Connection done");

}
}catch (Exception e) {

}

%>

ISSUE:

Now , when I do same configuration using "Apache Sling Connection Pooled DataSource". I do not get "Connection Done" output from JSP , I mean connection is not getting established .

 

issue.png

 
 

Could you please help me out . Thank you.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

I would recommend setting DEBUG logger on the PID's of both configs and check what's going on in the logs.

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

I would recommend setting DEBUG logger on the PID's of both configs and check what's going on in the logs.