与Adobe CQ5外部数据库? [英] external database with Adobe CQ5?

查看:158
本文介绍了与Adobe CQ5外部数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么办法可以连接如外部数据库的 MySQL的可以连接到的Adobe CQ5

Is there any way to connect external data base like mysql can be connected to Adobe CQ5?

JCR(Java内容仓库)在Adobe现在默认连接到H2数据库CQ5 ......如何使其使用SQL / MySQL的?

JCR(Java Content Repository) in Adobe cq5 now by default connects to H2 database...how to make it use sql/mysql?

推荐答案

转到:/系统/控制台/的ConfigMgr
打开:在JDBC连接池配置
输入所有标准的JDBC配置元素(用户名,密码,驱动程序,JDBC URI)
输入数据源名称(以下简称yourDataSourceName)

Go to: /system/console/configMgr
Open up: the JDBC Connections Pool configuration
Enter all the standard JDBC config elements (username, password, driver, JDBC URI)
Enter a Datasource Name (referred to below as yourDataSourceName)

在你的JSP或Servlet的:

In your JSP or Servlet:

<%@ page import="com.day.commons.datasource.poolservice.DataSourcePool" %>
<%@ page import="javax.sql.DataSource" %>

DataSourcePool dbService = sling.getService(DataSourcePool.class);
DataSource ds = (DataSource) dbService.getDataSource("yourDataSourceName");

if(ds != null) {
   try {
      %><sql:query var="result" sql="SELECT now()" dataSource="<%=ds%>" /><%
   } catch (Exception e) { } 
}

这篇关于与Adobe CQ5外部数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆