majd obeid
majd obeid

Reputation: 109

Eclipse + Hibernate + windows xp to win 7

I have an eclipse installed at windows xp and everything works fine. My project is GWT with gilead hibernate and the database is oracle.

When i decided to work from home, i just copied the entire eclipse to my flash memory with my workspace to my windows 7.

After that i decided to move from oracle Db to mysql Db, so i change the entire hibernate.cfg.xml file to make ready for mysql, i deleted the ojdbc library and added the mysql connector.

After all of that when i try to run the project the error below is shown:

Could not connect to the database

it's like the eclipse is reading from the old hibernate.cfg.xml file.

So does anybody know what is happening ???

This is my hibernate.cfg.xml file for oracle connetion:

<?xml version="1.0" encoding="utf-8"?>
<hibernate-configuration>
<session-factory name="">
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
<property   name="hibernate.connection.url">jdbc:oracle:thin:@IP:1521:DEVDB10GR2</property>
<property name="hibernate.connection.username">something</property>
<property name="hibernate.connection.password">something</property>
<property name="hibernate.show_sql">true</property>
<property name="format_sql">true</property>
<mapping class="net.school.shared.hibernate.GsWorkingshift"/>
</session-factory>
</hibernate-configuration>

This is my hibernate.cfg.xml file for mySql connetion:

<?xml version="1.0" encoding="utf-8"?>
<hibernate-configuration>
<session-factory name="">
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost  /hibernatetutorial</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.show_sql">true</property>
<property name="format_sql">true</property>
<mapping class="net.school.shared.hibernate.GsWorkingshift"/>
</session-factory>
</hibernate-configuration>

after i do this this error is keep sowing:

Could not connect to oracle

but when i try it on my work PC it works fine.

Upvotes: 1

Views: 372

Answers (1)

Muhammad Imran Tariq
Muhammad Imran Tariq

Reputation: 23352

First check your Database sever is live. Connect with any database explorer software to access your database tables. Then clean build your code and try restarting your web server. Problem could be with database server or its credentials.

Upvotes: 0

Related Questions