posted 11 years ago
I am new to hibernate and facing this new problem i am unaware of.
I have hibernate.properties file that contains all the information related to MySQL JDBC connectivity.
Then I have another properties file that contains following information:
hibernate.connection.datasource=TESTDS
hibernate.show_sql=true
hibernate.connection.provider_class=net.sf.hibernate.connection.C3P0ConnectionProvider
hibernate.c3p0.acquireIncrement=5
hibernate.c3p0.idleConnectionTestPeriod=1200
hibernate.c3p0.maxPoolSize=100
hibernate.c3p0.maxStatements=0
hibernate.c3p0.minPoolSize=1
hibernate.c3p0.initialPoolSize=20
I am creating a SessionFactory as given below:
Configuration cfg = new Configuration();
Properties properties = new Properties();
try {
properties.load(new FileInputStream("Sample.hibernate.properties"));
} catch (IOException e) {
}
cfg = cfg.setProperties(properties);
cfg = cfg.setProperty("hibernate.dialect", "org.hibernate.dialect.Oracle9Dialect");
cfg = cfg.addResource("com/sungard/cs/aata/root/pojo/Root.hbm.xml");
cfg = cfg.addResource("com/sungard/cs/aata/tlog/pojo/Tlog.hbm.xml");
SessionFactory sf = cfg.buildSessionFactory();
HibernateTemplate sample = this.createHibernateTemplate(sf);
When i start server i get warning "java.lang.UnsupportedOperationException: The user must supply a JDBC connection".
Can someone help me know what is the solution to this exception?
Thanks in advance,
Ashish