java - MyBatis Generator with multiple databases -
i'm trying generate "mybatis generator" mappers 3 tables, first 2 in 1 database (derby sample) , last 1 in database (birt sample).
i'm using rad 8.5 derby.
here xml configuration file
<?xml version="1.0" encoding="utf-8"?> <!doctype generatorconfiguration public "-//mybatis.org//dtd mybatis generator configuration 1.0//en" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> <generatorconfiguration> <classpathentry location="c:\users\xxx\ibm\rationalsdp\workspace\example\webcontent\web-inf\lib\derby.jar"/> <!-- primo database --> <context id="derbytables" targetruntime="mybatis3"> <jdbcconnection driverclass="org.apache.derby.jdbc.embeddeddriver" connectionurl="jdbc:derby:c:\users\xxx\ibm\rationalsdp\workspace\.metadata\.plugins\com.ibm.datatools.db2.cloudscape.driver\sample;create=true" userid="admin" password="admin"> </jdbcconnection> <javatyperesolver > <property name="forcebigdecimals" value="false" /> </javatyperesolver> <javamodelgenerator targetpackage="test.model" targetproject="example\src"> <property name="enablesubpackages" value="true" /> <property name="trimstrings" value="true" /> </javamodelgenerator> <sqlmapgenerator targetpackage="test.dao.samp" targetproject="example"> <property name="enablesubpackages" value="true" /> </sqlmapgenerator> <javaclientgenerator type="xmlmapper" targetpackage="test.dao" targetproject="example\src"> <property name="enablesubpackages" value="true" /> </javaclientgenerator> <table schema="samp" tablename="staff" domainobjectname="staff"> <property name="useactualcolumnnames" value="true" /> </table> <table schema="samp" tablename="sales" domainobjectname="sales"> <property name="useactualcolumnnames" value="true" /> </table> </context> <!-- secondo database --> <context id="secondtables" targetruntime="mybatis3"> <jdbcconnection driverclass="org.apache.derby.jdbc.embeddeddriver" connectionurl="jdbc:derby:c:\users\xxx\ibm\rationalsdp\workspace\.metadata\.plugins\org.eclipse.birt.report.data.oda.jdbc.dbprofile.sampledb/db/birtsample;create=true" userid="admin" password="admin"> </jdbcconnection> <javatyperesolver > <property name="forcebigdecimals" value="false" /> </javatyperesolver> <javamodelgenerator targetpackage="test.model" targetproject="example\src"> <property name="enablesubpackages" value="true" /> <property name="trimstrings" value="true" /> </javamodelgenerator> <sqlmapgenerator targetpackage="test.dao.samp" targetproject="example"> <property name="enablesubpackages" value="true" /> </sqlmapgenerator> <javaclientgenerator type="xmlmapper" targetpackage="test.dao" targetproject="e\src"> <property name="enablesubpackages" value="true" /> </javaclientgenerator> <table schema="classicmodels" tablename="offices" domainobjectname="offices"> <property name="useactualcolumnnames" value="true"/> </table> </context> </generatorconfiguration>
when click right on generator configuration file following error:
failed start database
'c:\users\xxx\ibm\rationalsdp\workspace\.metadata\.plugins\org.eclipse.birt.report.data.oda.jdbc.dbprofile.sampledb/db/birtsample' class loader java.net.urlclassloader@5ffe2fe7, see next exception details. failed start database 'c:\users\xxx\ibm\rationalsdp\workspace\.metadata\.plugins\org.eclipse.birt.report.data.oda.jdbc.dbprofile.sampledb/db/birtsample' class loader java.net.urlclassloader@5ffe2fe7, see next exception details.
i couldn't find guide issue.
does know error or know guide mybatis generator multiple dbs?
it looks trying connect birt sample database. derby database up. can add ;shutdown=true , run once leave off the create=true , retry generation.
Comments
Post a Comment