• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic