No connection properties specified - the user must supply JDBC connections
Was trying to get setup with Hibernate and ran into the following error and stack trace:
INFO: using JDK 1.4 java.sql.Timestamp handling
Dec 26, 2007 11:40:40 AM org.hibernate.connection.UserSuppliedConnectionProvider configure
WARNING: No connection properties specified - the user must supply JDBC connections
Exception in thread "AWT-EventQueue-0" org.hibernate.HibernateException: Hibernate Dialect
must be explicitly set
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:426)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
This error occured as Hibernate was unable to locate the hibernate.cfg.xml file. To fix this, I had to change the way of calling the Hibernate Configuration class. For some reason, in my web based applications, the first example of calling the class worked perfectly. It did not work in my Swing application so I changed to the the second version below:
Version 1:
Configuration configuration = new org.hibernate.cfg.Configuration();
Version 2:
org.hibernate.cfg.Configuration configuration = new org.hibernate.cfg.Configuration().configure(”/hibernate.cfg.xml”);