CollinL wrote:
Your doctype declaration is referring to the hibernate 2.0 dtd. This isn't included in hibernate 3 jar, so the xml verifier tries to find it from the url in the doctype. Your computer can't access that, and is throwing an exception.
Change the doctype to:
Code:
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
Thanks Collin for pointing this out ...but I am still getting Dialect error
error
xception in thread "main" org.hibernate.HibernateException: The dialect was not set. Set the property hibernate.dialect.
at org.hibernate.dialect.Dialect.getDialect(Dialect.java:477)
at org.hibernate.dialect.Dialect.getDialect(Dialect.java:499)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:51)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1505)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1053)
at users.insertUsers.main(insertUsers.java:33)
My Hibernate cfg file
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-configuration>
<session-factory >
<!-- local connection properties -->
<property name="hibernate.connection.url">jdbc:oracle:thin:@hcl-node5:1521:cummins</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.username">cummins</property>
<property name="hibernate.connection.password">cummins</property>
<!-- property name="hibernate.connection.pool_size"></property -->
<!-- dialect for Oracle 9 -->
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JDBCTransactionFactory</property>
</session-factory>
</hibernate-configuration>
Proferty file
hibernate.dialect=net.sf.hibernate.dialect.Oracle9Dialect
hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
hibernate.connection.url=jdbc:oracle:thin:@hcl-node5:1521:cummins
hibernate.connection.username=cummins
hibernate.connection.password=cummins
I have tried changing dialect to org.hibernate.dialect.Oracle9Dialect but I get same error