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

Avatar

Avatar

msgtowers

Avatar

msgtowers

msgtowers

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.

View Entire Topic

Avatar

Avatar

rajkumark10

Avatar

rajkumark10

rajkumark10

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.