Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Problem in MySQL Connection

Avatar

Level 2

Hello,

I'm trying to use MySQL DB connection,

I've configured in OSGi also.

When I try to do

"@Reference

private DataSourcePool source"

it is giving null value to it, hence it is giving error while we try do source.getDataSource("DataBaseTravel");

I'm Using AEM 6.4v.

krishh_187smacdonald2008

Thanks in Advance

4 Replies

Avatar

Community Advisor

Hi,

Please check your imports.

Below is sample code to get connection from DataSourcePool service.

aem63app-repo/DSConnectionImpl.java at master · arunpatidar02/aem63app-repo · GitHub



Arun Patidar

Avatar

Level 2

Thank you for replying, but still it is not working for me.

Whether is there problem with AEM 6.4?

Avatar

Employee Advisor

How have you configured your datasource? Do you see in the error.log the string "datasource" (check case-insensitiv!)

Jörg

Avatar

Level 2

Thank You for replying.

Now it is Working for me,the problem was in the mysql-connector version.