Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Hibernate
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Hibernate section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 1st, 2007, 02:26 AM
Registered User
 
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default MySQL hibernate connection error

Can any body help me how to connect to a mysql service running on a my machine using hibernate. I am able to connect using localhost or loopback address(127.0.0.1) but i am in a network and i dont want to give localhost insteadi want to give ipaddress of the machine some thing like 192.145.25.21.
if i give <property name="connection.url">
jdbc:mysql://192.145.25.21:3306/hibernate</property> it's not working. It's throwing an error while trying to open session.

In stead of the ip address if i specify localhost/127.0.0.1, it's working properly..Any body's there to help...?



 
Old April 25th, 2007, 03:49 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

One thing you need to check is whether MySql service accepts network connections of not, and second the port number and the ip are correct or not. i guess connection through network to the mysql database is disabled in that system.

Hope that solves your problem

Regards,
Rakesh
 
Old May 11th, 2009, 06:31 AM
Registered User
 
Join Date: May 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got the same exception & resolved the issue after 3 hectic days.Check if you are using I hibernate3. In this version it is req to explicitly mention the connection class name. Also check if the jar is in classpath. Check steps & comments in below link

http://hibernatedb.blogspot.com/2009...ernate-to.html

Remove autoReconnec=true





Similar Threads
Thread Thread Starter Forum Replies Last Post
Hibernate Spring and HSQLDB Error chfarooq Hibernate 0 January 10th, 2008 11:18 AM
MySQL lost connection error melkin Classic ASP Basics 1 October 27th, 2007 06:37 AM
Hibernate Error :javax/transaction/Synchronization orange_jhon Hibernate 0 August 7th, 2007 03:46 AM
connection error MYSQL and ASP renee_santoscoi MySQL 5 March 7th, 2005 11:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.