Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to GoDaddy dB with Hibernate

Status
Not open for further replies.

troyarch

MIS
Mar 12, 2003
29
0
0
US
I have created a Java web application that uses Hibernate to pull data from a MySQL database that is on my PC. The app works correctly when I run it locally on a Tomcat server on my PC. When I upload the WAR file to the GoDaddy server and use the database on the GoDaddy server I cannot pull data from the database--that is where I need help. The database name, username, password, and database structure is identical on both my PC and the GoDaddy server. I think the only difference would be the hostname; where do I make that change in my project? Any help that can be provided would be great. Thanks.
 
I bet the driver will be different too. How are you doing the connection?

Cheers,
Dian
 
In my hibernate.cfg file these are a couple of my property elements. Does this answer your question?

<property name="connection.driver.class">com.mysql.jdbc.Driver</property>
<property name="connection.datasource">java:/comp/env/jdbc/MySQLDB</property>
 
Oh, sorry, I thought goDaddy was a kind of database.

Is the DB hosted in goDaddy too? If so, you're right, you'll have to change the name of the host the program is connecting to.

Cheers,
Dian
 
I know the name of the GoDaddy host but do you know where I am supposed to make the change in my code? Besides the server.xml file, which is only used for running on my PC (I think), I do not know of any other files in my web app where I would make the hostname change. Thanks for your continued help!
 
Well, it's difficult to know without looking at the code. Maybe you harcoded the host name or maybe you externalized it to a properties file.

Cheers,
Dian
 
Is there a sample JSP that I can use to test a database connection to the MySQL database that I have set up on the GoDaddy shared server? I already know the GoDaddy hostname, database name, username, and password. Thanks again for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top