iceman
10-12-2005, 02:51 PM
How to connect to MySQL
See http://wiki.jboss.org/wiki/Wiki.jsp?page=SetUpAMysqlDatasource
Sample mysql-ds.xml file:
<&;?xml version="1.0" encoding="UTF-8"?>&;
<&;!-- ===================================================================== -->&;
<&;!-- -->&;
<&;!-- JBoss Server Configuration -->&;
<&;!-- -->&;
<&;!-- ===================================================================== -->&;
<&;!-- ==================================================================== -->&;
<&;!-- Datasource config for MySQL using 2.0.11 driver -->&;
<&;!-- ==================================================================== -->&;
<&;datasources>&;
<&;local-tx-datasource>&;
<&;jndi-name>&;jdbc/mysqllocal<&;/jndi-name>&;
<&;connection-url>&;jdbc:mysql://localhost:3306/test<&;/connection-url>&;
<&;driver-class>&;com.mysql.jdbc.Driver<&;/driver-class>&;
<&;user-name>&;root<&;/user-name>&;
<&;password>&;<&;/password>&;
<&;/local-tx-datasource>&;
<&;/datasources>&;
Then you can create a SQLLookupRule to use this datasource (embed in an action.xml document, I used SQL_Datasource.action.xml as a template):
<&;component-name>&;org.pentaho.component.SQLLookupRule<&;/component-name>&;
<&;action-type>&;rule<&;/action-type>&;
<&;component-definition>&;
<&;jndi>&;jdbc/mysqllocal<&;/jndi>&;
<&;query>&;<&;![CDATA[select column1, column2 from mytesttable]]>&;<&;/query>&;
<&;/component-definition>&;
Post edited by: iceman, at: 10/12/2005 18:53
See http://wiki.jboss.org/wiki/Wiki.jsp?page=SetUpAMysqlDatasource
Sample mysql-ds.xml file:
<&;?xml version="1.0" encoding="UTF-8"?>&;
<&;!-- ===================================================================== -->&;
<&;!-- -->&;
<&;!-- JBoss Server Configuration -->&;
<&;!-- -->&;
<&;!-- ===================================================================== -->&;
<&;!-- ==================================================================== -->&;
<&;!-- Datasource config for MySQL using 2.0.11 driver -->&;
<&;!-- ==================================================================== -->&;
<&;datasources>&;
<&;local-tx-datasource>&;
<&;jndi-name>&;jdbc/mysqllocal<&;/jndi-name>&;
<&;connection-url>&;jdbc:mysql://localhost:3306/test<&;/connection-url>&;
<&;driver-class>&;com.mysql.jdbc.Driver<&;/driver-class>&;
<&;user-name>&;root<&;/user-name>&;
<&;password>&;<&;/password>&;
<&;/local-tx-datasource>&;
<&;/datasources>&;
Then you can create a SQLLookupRule to use this datasource (embed in an action.xml document, I used SQL_Datasource.action.xml as a template):
<&;component-name>&;org.pentaho.component.SQLLookupRule<&;/component-name>&;
<&;action-type>&;rule<&;/action-type>&;
<&;component-definition>&;
<&;jndi>&;jdbc/mysqllocal<&;/jndi>&;
<&;query>&;<&;![CDATA[select column1, column2 from mytesttable]]>&;<&;/query>&;
<&;/component-definition>&;
Post edited by: iceman, at: 10/12/2005 18:53