MySql Database not connected (unable to data retriew error showing)i followed Adobe cq Document | Community
Skip to main content
Level 2
October 16, 2015
Solved

MySql Database not connected (unable to data retriew error showing)i followed Adobe cq Document

  • October 16, 2015
  • 14 replies
  • 3753 views

Hi,

I followed in adobe cq5 document exactly store the data in my MySQL but i got problem in application when i am submitting user details it throw unable to retrieve  data i import every thing jquery files and js files can help me am new to cq5 below document i follow.

http://helpx.adobe.com/experience-manager/using/querying-persisting-cq-data-mysql.html

 

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

This JSP code:

var url = location.pathname.replace(".html", "/_jcr_content.query.json") + "?filter="+ filter;

sends  a request to this JS file:

<%@include file="/libs/foundation/global.jsp"%>
<%@ page import="org.apache.sling.commons.json.io.*,org.w3c.dom.*" %><%
String filter = request.getParameter("filter");
    
com.adobe.aem.sql.CustomerServiceImp cs = new com.adobe.aem.sql.CustomerServiceImp();
 
String XML = cs.getCustomerData(filter); 
    
//Send the data back to the client
JSONWriter writer = new JSONWriter(response.getWriter());
writer.object();
writer.key("xml");
writer.value(XML);
    
writer.endObject();
%>

This JS file creates an object of type com.adobe.aem.sql.CustomerServiceImp. This Java class is bundled in the OSGi that you created. 

There are three places where something may be wrong:

1. You did not setup the connection class properly.

2. The drvier file is not bundled. 

3. The main page JSP is not finding the query.js file.

Please post your log file - we can tell what is happening from that. 

 

14 replies

Level 2
October 16, 2015

Hi ,

I followed that one also i tried more times but am not getting ,when i entered user details custId showing "Zero" and not adding details.

i have doubt in this jsp code

var ur = location.pathname.replace(".html", "/_jcr_content.query.json") 

can u explain i shared screen shot can u guide me how to  form  data storing Mysql database

Thanks.

smacdonald2008
Level 10
October 16, 2015

I just re-tested that article - it produced the following CQ app:

[img]client.png[/img]

If you are still having issues, email me at scottm@adobe.com. I can setup a connect session. 

joerghoh
Adobe Employee
Adobe Employee
October 16, 2015

Hi,

can you provide some logs (e.g. uploading somwhere and posting the link here?); it's hard to do a problem analysis based on the information you provided.

Thanks,
Jörg

smacdonald2008
Level 10
October 16, 2015

Try this article 

http://helpx.adobe.com/experience-manager/using/datasourcepool.html

 

The difference is you are using a DataSourcePool to connect instead of writing a custom connection handler.