Bonjour je dois passer d'une base de donnée Oracle à une BD POSTGRES, la persistance des données est gérée par Hibernate. Actuellement, avec la BD oracle tout marche bien j'arrive à insérer des données et voir les données. J'ai recrée la même base en postgres, mais ca marche pas. J'ai oublié de préciser que j'accede au database depuis un serveur tomcat su lequel je déployer des web services.

Voici le fichier database-beans.xml d'Oracle
*************************************************************************
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
      http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
 
        <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
                <property name="driverClass" value="oracle.jdbc.driver.OracleDriver"/>
                <property name="jdbcUrl" value="jdbc:oracle:thin:@//172.20.3.4:1521/b2idb_taf"/>
                <property name="user" value="scratch" />
                <property name="password" value="bgan31" />
                <property name="maxPoolSize" value="5" />
                <property name="minPoolSize" value="1" />
                <property name="maxIdleTime" value="5000" />
        </bean>
 
        <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
                <property name="dataSource" ref="dataSource" />
                <property name="jpaVendorAdapter">
                        <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                                <property name="generateDdl" value="false" />
                                <property name="databasePlatform" value="org.hibernate.dialect.Oracle9Dialect" />
                        </bean>
                </property>
        </bean>
 
        <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
 
    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory" />
    </bean>
 
    <tx:annotation-driven />
 
    <bean id="carteDaoJpaImpl" class="com.viveris.vizada.soapServices.model.carte.CarteDAOJPAImpl"/>
 
</beans>
*****************************************************************************



POUR CELLE DE POSTGRES J AI JUSTE CHANGE LES PARTIES QUI ONT UN RAPPORT AVEC PostGres:
=========================================================================
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
      http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
 
        <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
                <property name="driverClass" value="org.postgresql.Driver"/>
                <property name="jdbcUrl" value="jdbc:postgresql://localhost:5432/Cards"/>
                <property name="user" value="toto" />
                <property name="password" value="1234" />
                <property name="maxPoolSize" value="10" />
                <property name="minPoolSize" value="1" />
                <property name="maxIdleTime" value="5000" />
        </bean>
 
        <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
                <property name="dataSource" ref="dataSource" />
                <property name="jpaVendorAdapter">
                        <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                                <property name="generateDdl" value="false" />
                                <!--<property name="databasePlatform" value="org.hibernate.dialect.PostgreSQLDialect" />-->
                                <property name="databasePlatform" value="org.hibernate.dialect.ProgressDialect" />
                        </bean>
                </property>
        </bean>
 
        <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
 
    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory" />
    </bean>
 
    <tx:annotation-driven />
 
    <bean id="carteDaoJpaImpl" class="com.viveris.vizada.soapServices.model.carte.CarteDAOJPAImpl"/>
 
</beans>
===========================================================================