Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.UnsupportedOperationException: The user must supply a JDBC connection

 
Ashish Sathaye
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
pandya devarshi r
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ashish,
What is this Ashish?
cfg = cfg.setProperty("hibernate.dialect", "org.hibernate.dialect.Oracle9Dialect");
You should use my sql dialect not use oracle dialect. And one more thing can you give me a mysql connection propertly file,which is use for this application.


Thanks
Devarshi
 
Ashish Sathaye
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Devashree,
I had two databases. One was oracle and other was mysql. Anyways that problem is resolved. Thanks for post on topic. I am creating new topic now :) . Hoping to get reply on that one also :D
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic