Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to create a Microsoft SQL connection on AEM Forms 6.3?

Avatar

Avatar
Validate 1
Level 1
msgtowers
Level 1

Likes

0 likes

Total Posts

34 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
msgtowers
Level 1

Likes

0 likes

Total Posts

34 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
msgtowers
Level 1

19-10-2017

I am new to AEM Forms 6.3, but I have used LiveCycle ES4.  Under LiveCycle ES4 to create a connection, I added the SQL connection string to the adobe-ds.xml file under the deploy directory.  After restarting JBoss, I could use to connection to create a WSDL.  On AEM Forms 6.3 to add a SQL connection, do I have to use configMgr?  If I have to use it, how do I install it?  Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

19-10-2017

In AEM - to connect to a Database - you need to write OSGi logic and use a DataSourcePool.

See this new Article we just put out.

Scott's Digital Community: Creating a Mail List Component for the Experience Manager Toy Store Site

It shows you how to write a OSGi service that uses a DataSourcePool. It also shows you how to configure a DataSourcePool service.

We used MySQL as an example - but this will point you in the right direction.

To get the data from a form to an OSGi, you can write a custom Form action too:

Scott's Digital Community: Creating a custom action for an Adobe Experience Manager Form component

Hope this helps....

Answers (3)

Answers (3)

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

309 likes

Total Posts

1,131 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

309 likes

Total Posts

1,131 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

14-05-2019

6.3 onwards, in case you want to configure your Adaptive forms to connect to Database or any other Datasource you can use Form Data Model.

Form Data Model(FDM): AEM Forms data integration module allows you to create a form data model from disparate backend data sources such as AEM user profile, RESTful web services, SOAP-based web services, OData services, and relational databases. You can configure data model objects and services in a form data model and associate it with an adaptive form. Adaptive form fields are bound to data model object properties. The services enable you to prefill the adaptive form and write submitted form data back to the data model object.

Adobe Experience Manager Help | AEM Forms Data Integration

Avatar

Avatar
Validate 1
Level 1
rajkumark10
Level 1

Likes

2 likes

Total Posts

19 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
rajkumark10
Level 1

Likes

2 likes

Total Posts

19 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
rajkumark10
Level 1

13-05-2019

Hi Smacdonald2008,

I am trying to connect with MYSQL. I have given JDBC configuration and used below code. But in below code i am getting datasource pool as null. Can you please help me to find where i am doing mistake?

@Reference

private DataSourcePool ds;

 

//Returns a connection using the configured DataSourcePool

private Connection getConnection()

{

LOGGER.info("************Inside get connection*********" + ds);

         DataSource dspService = null;

         Connection con = null;

        

         try

         {

        dspService = (DataSource) ds.getDataSource("hsqldbds");

        LOGGER.info("************Inside IF*********");

        if(dspService != null) {

        LOGGER.info("************Inside IF*********");

                 final Connection connection = ((DataSource) dspService).getConnection();

                  final Statement statement = connection.createStatement();

                 final ResultSet resultSet = statement.executeQuery("SELECT * from pet");

                  int r=0;

                  LOGGER.info("************Working*********");

                  while(resultSet.next()){

                     r=r+1;

                  }

                  resultSet.close();

                  }

            

           }

         catch (Exception e)

         {

        LOGGER.info("************ERROR*********" + e.getMessage());

             e.printStackTrace();

         }

             return con;

}

Also, Can you share me driver need to be used for SQL DB in AEM 6.4.

Avatar

Avatar
Give Back
Level 1
coldwarsoldier
Level 1

Likes

0 likes

Total Posts

10 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
View profile

Avatar
Give Back
Level 1
coldwarsoldier
Level 1

Likes

0 likes

Total Posts

10 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
View profile
coldwarsoldier
Level 1

19-10-2017

The file to edit for a database connection under AEM Forms 6.3 is  lc_turnkey.xml.