Friday, 27 April 2012

Creating an Adobe CQ web application that uses MySQL

You can create an Adobe CQ web application that performs database operations on a relational database. For example, you can create an Adobe CQ web application that retrieves data from MySQL and displays the data in a JSP. The following illustration shows data being retrieved from a relational database and displayed in a JSP.

To read this entire article, click this link:

https://helpx.adobe.com/experience-manager/using/creating-cq-web-application-uses.html

If you are interested in learning how to persist Adobe CQ data into MySQL, click here: http://scottsdigitalcommunity.blogspot.ca/2013/01/persisting-adobe-cq-data-in-relational.html.


Adobe Digital Marketing Community


Join the Adobe Digital Marketing Community. Start by clicking this banner

About the Author

I (Scott Macdonald) am a Senior Digital Marketing Community Manager at Adobe Systems with over 16 years in the high tech industry. I am also a programmer with knowledge in Java, JavaScript, C#,C++, HTML, XML and ActionScript. If  you would like to see more CQ or other Adobe Digital Marketing end to end articles like this, then leave a comment and let me know what content you would like to see.

Linked Inhttp://www.linkedin.com/in/scottmacdonald2010
TwitterFollow the Digital Marketing Customer Care team on Twitter @AdobeMktgCare.


6 comments:

  1. Hello,

    I am trying to connect to a external MySQL database from within a bundle.
    But I keep getting this error:
    Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure Last packet sent to the server was 0 ms ago.)

    These are the details:
    1) Spring bundle(using Spring DM)
    2) MySQL database is at port 7046 so my bean is as below:








    My code connects to the mysql database from local felix installation. But when I put the same bundle within CQ I get the error.

    Please help.
    Karan
    (jaskaran81@yahoo.com)

    ReplyDelete
  2. Could you please post one working example of Sling Filter? I have seen the documentation, but it does not help much.

    ReplyDelete
  3. I will add this to the list of Blog items - working with Sling, Filters ,etc. Thanks!

    ReplyDelete
  4. Hi Scott, Not sure if you know but there is a JDBC connection pool factory in CQ5 which allows you to a DataSource service in Felix containing the jdbc driver and connection properties. Then that service can be used by any Osgi service or component jsp to retrieve the jdbc connection and make calls. That would avoid the need for your connectionhelper. Hope this helps.

    Sarwar

    ReplyDelete
  5. Thanks for the comment - i am aware of the connection pool. I will be writing another artilce that shows how to connect to the connection pool. The objective of this artilce was to show how to create an OSGi that talks to a database with only Java APIs. Thanks for your comment.

    ReplyDelete
  6. Here is the AEM article that talks about using the DataSourcePool:

    http://scottsdigitalcommunity.blogspot.ca/2013/09/injecting-datasourcepool-service-into.html

    ReplyDelete