Hello, all. I am trying to get my first POJO to map to a DB2 database. After struggling to get it set up, I now come up with this error (listed below), and I cannot fix it thus far (and I've read the pdf docs, but perhaps I'm missing it?). All my code does is this:
private static Configuration configuration;
private static SessionFactory sessionFactory;
private static Log log = LogFactory.getLog(Test.class);
static
{
try
{
configuration = new Configuration();
sessionFactory = configuration.configure().buildSessionFactory();
}
catch (Throwable t)
{
t.printStackTrace();
}
}
Hibernate version:3 beta4
Mapping documents:
Here is my hibernate.cfg.xml file:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="dialect">org.hibernate.dialect.DB2Dialect</property>
<property name="connection.driver_class">COM.ibm.db2.jdbc.app.DB2Driver</property>
<property name="connection.url">jdbc:db2:SISREP</property>
<property name="connection.username">iepxs</property>
<property name="connection.password">tw0=0n3</property>
<!-- Print SQL to stdout. -->
<property name="show_sql">true</property>
<mapping resource="edu/asu/sis/CourseMapping.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Here is my CourseMapping.hbm.xml file (referenced in the cfg file):
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping SYSTEM
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="edu.asu.sis.impl" >
<class name="edu.asu.sis.impl.CourseImpl" table="COURSE_REC" lazy="true">
<!-- Common id property. -->
<id name="courseID"
type="long"
column="P_K"
unsaved-value="null"
access="property">
</id>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:
java.lang.UnsatisfiedLinkError: SQLAllocEnv
at COM.ibm.db2.jdbc.app.DB2Driver.SQLAllocEnv(Native Method)
at COM.ibm.db2.jdbc.app.DB2Driver.<init>(DB2Driver.java:249)
at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(DB2Driver.java:131)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
.
.
.
Name and version of the database you are using:DB2 (v8)
Any help you can offer is greatly appreciated - I'm getting frustrated because I can't get past this part! Thanks.
Patrick
|