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

Hibernate: Couldn't get connection pooling to work

 
Choon-Chern Lim
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I followed this hibernate tutorial at http://www.gloegl.de/8.html and I a little modification to it so that it runs in J2EE app. I could get it to work with regular jdbc connection based on the setting below:-



So, I tried to convert it to run with connection pooling with the following settings:-



When I run it again, I get the following error:-



At first, I thought I messed up my JNDI settings in my server and web.xml. So, I did a test on the following codes with the same sql statement generated by hibernate, and it works:-



May I know where I set wrongly in my hibernate.cfg.xml for my connection pooling? I have been messing around for 2 hours now, but still couldn't get it to work.

Any tips would be greatly appreciated! Thanks.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[IBM][SQLServer JDBC Driver]Unsupported method: Connection.prepareStatement

What driver are you using? Because it seems to be saying that it doesn't support Connection.prepareStatement...
 
Choon-Chern Lim
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Paul,

I'm using the driver from WAS v6... com.ibm.websphere.jdbcx.sqlserver.SQLServerDataSource, that driver was provided when I set up my JNDI in the server.

Somehow, I could get it to work when I look up the JNDI by writing my own codes... but I'm clueless why it's not working with hibernate.

Thanks.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how good that driver is - you might try a different one (google for jTDS) or ask the folks in the WebSphere forum. The error message suggests Hibernate is trying to use a method that is unsupported by that driver.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic