Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3.0.5
Mapping documents:
hibernate.cfg.xml
<hibernate-configuration>
<session-factory>
<property name="myeclipse.connection.profile">OracleCSC</property>
<property name="connection.url">
jdbc:oracle:thin:@myhost:1521:CSC
</property>
<property name="connection.username">app</property>
<property name="connection.password">app</property>
<property name="connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="dialect">
org.hibernate.dialect.Oracle9Dialect
</property>
<property name="database.product">Oracle 9i</property>
</session-factory>
</hibernate-configuration>
Code between sessionFactory.openSession() and session.close():
Configuration config = new Configuration();
config.addClass(Tracking.class);
SessionFactory sessionfactory = null;
Session session = null;
Transaction tx = null;
try {
sessionfactory = config.buildSessionFactory();
session = sessionfactory.openSession();
tx = session.beginTransaction();
Tracking tracking = new Tracking();
tracking.setEnteredshop(new Long("1122360860490"));
tracking.setOmsid("1324567980");
tracking.setPartnerId("0061742467");
tracking.setCategory("1"); //null,1,2,3
tracking.setShopDay(new Long("1"));
tracking.setShopMonth(new Long("8"));
tracking.setShopYear(new Long("2005"));
session.save(tracking);
tx.commit();
} catch(Exception e) {
e.printStackTrace();
if(tx != null) {
tx.rollback();
}
} finally {
session.close();
sessionfactory.close();
}
Full stack trace of any exception that occurs:
org.hibernate.connection.UserSuppliedConnectionProvider - No connection properties specified - the user must supply JDBC connections
org.hibernate.HibernateException: database product name cannot be null
at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:374)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:110)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
at mypackage.TrackingFiller.main(TrackingFiller.java:22)
java.lang.NullPointerException
mypackage.TrackingFiller.main(TrackingFiller.java:46)
Exception in thread "main"
Name and version of the database you are using:
Oracle 9i
I cannot find any hint in the docs or google. Any help would be appreciated!
Regards,
Chris