I am attempting to set up Castor JDO to connect to a DB2 Database. However,
I get the following exception:
[jdoTest] Loading mapping descriptors from
file:/C:/Eclipse/eclipse/workspace/DataBinding/jdoTest/department.xml
[jdoTest] org.exolab.castor.jdo.DatabaseNotFoundException: Nested error:
java.sql.SQLException: No suitable driver
[jdoTest] java.sql.SQLException: No suitable driver
[jdoTest] at java.sql.DriverManager.getDriver(Unknown Source)
[jdoTest] at
org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(Unknown Source)
[jdoTest] at org.exolab.castor.jdo.JDO.getDatabase(Unknown Source)
[jdoTest] at jdoTest.Test.run(Test.java:86)
[jdoTest] at jdoTest.Test.main(Test.java:58)
I have the DB2 driver loaded in my classpath.
Here is my database file:
<database name="sample" engine="db2">
<driver class="COM.ibm.db2.jdbc.app.DB2Driver" url="jdbc:db2:SAMPLE">
<param name="user" value="db2user" />
<param name="password" value="db2password" />
</driver>
<mapping href="department.xml" />
</database>
Here is my mapping:
<!DOCTYPE databases PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"
"http://castor.exolab.org/mapping.dtd">
<mapping>
<!-- Mapping for Department -->
<class name="jdoTest.generated.Department"
identity="deptno">
<description>Department</description>
<map-to table="department" xml="department" />
<field name="deptno" type="string" >
<sql name="deptno" type="char" dirty="check" />
<xml node="text"/>
</field>
<field name="deptname" type="string">
<sql name="deptname" type="varchar" dirty="check" />
<xml node="text" />
</field>
<field name="mgrno" type="string">
<sql name="mgrno" type="char" dirty="check" />
<xml node="text" />
</field>
<field name="admrdept" type="string">
<sql name="admrdept" type="char" dirty="check" />
<xml node="text" />
</field>
<field name="location" type="string">
<sql name="location" type="char" dirty="check" />
<xml node="text" />
</field>
</class>
</mapping>
Thanks in advance!
Best,
Ray
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev