IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Hibernate Java Discussion :

Passage MySQL -> HSQL : ERROR: invalid schema name: DEFIB in statement


Sujet :

Hibernate Java

  1. #1
    Membre régulier
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    676
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 676
    Points : 121
    Points
    121
    Par défaut Passage MySQL -> HSQL : ERROR: invalid schema name: DEFIB in statement
    Bonjour,

    J'ai utilisé MySQL pour mon projet avec Hibernate Tools et ça s'est très bien passé. Mais j'ai un souci maintenant, la personne à qui je fait une démonstration n'arrive pas à installer une base MySQL sur son PC de boulot (il y a des blocage pour WAMP comme pour MySQL Workbench) et il dis "je m'en sors pas, je suis nul, c'est trop compliqué". Du coup pour la démo, j'aimerais passer à HSQL et une base intégré dans l'outil, pas un truc en plus à installé. Mais j'ai un souci et j'ai une erreur qui s'affiche.

    Code de création de la session Hibernate :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
        static {
            try {
                // Créer une SessionFactory à partir du cfg.xml
                //sessionFactory = new Configuration().configure("mysql.cfg.xml").buildSessionFactory(); //MYSQL
                sessionFactory = new Configuration().configure("hsqldb.cfg.xml").buildSessionFactory(); //HSQL
            } catch (Throwable ex) {
                // Gestion exception
                System.err.println("Echec création SessionFactory" + ex);
                throw new ExceptionInInitializerError(ex);
            }
        }
    hsqldb.cfg.xml :
    Code : 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
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-configuration PUBLIC
    		"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    		"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
        <session-factory>
            <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
            <property name="hibernate.connection.url">jdbc:hsqldb:file:defib</property>
            <property name="hibernate.connection.username">sa</property>
            <property name="hibernate.connection.password"></property>
            <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
     
            <!-- Montrer toutes les réquêtes générées -->
            <property name="show_sql">true</property>
     
            <!-- Mapping files -->
            <mapping resource="objets/Action.hbm.xml"/>
            <mapping resource="objets/Cardiopathie.hbm.xml"/>
            <mapping resource="objets/Deci.hbm.xml"/>
            <mapping resource="objets/Etude.hbm.xml"/>
            <mapping resource="objets/FamilleMessage.hbm.xml"/>
            <mapping resource="objets/Lecture.hbm.xml"/>
            <mapping resource="objets/Message.hbm.xml"/>
            <mapping resource="objets/ModeleDeci.hbm.xml"/>
            <mapping resource="objets/MotifImplantation.hbm.xml"/>
            <mapping resource="objets/Patient.hbm.xml"/>
            <mapping resource="objets/Personnel.hbm.xml"/>
            <mapping resource="objets/Rdv.hbm.xml"/>
            <mapping resource="objets/TypeMessage.hbm.xml"/>
     
        </session-factory>
    </hibernate-configuration>
    Personnel.java :
    Code : 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
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    package objets;
     
    // Generated 5 févr. 2015 16:33:41 by Hibernate Tools 4.0.0
     
    import java.util.HashSet;
    import java.util.Set;
     
    /**
     * Personnel generated by hbm2java
     */
    public class Personnel implements java.io.Serializable {
     
    	private Integer idPersonnel;
    	private String nom;
    	private String prenom;
    	private boolean isMedecin;
    	private Set<Action> actions = new HashSet<Action>(0);
    	private Set<Rdv> rdvs = new HashSet<Rdv>(0);
    	private Set<Lecture> lectures = new HashSet<Lecture>(0);
    	private Set<Patient> patients = new HashSet<Patient>(0);
     
    	public Personnel() {
    	}
     
    	public Personnel(String nom, String prenom, boolean isMedecin) {
    		this.nom = nom;
    		this.prenom = prenom;
    		this.isMedecin = isMedecin;
    	}
     
    	public Personnel(String nom, String prenom, boolean isMedecin,
    			Set<Action> actions, Set<Rdv> rdvs, Set<Lecture> lectures,
    			Set<Patient> patients) {
    		this.nom = nom;
    		this.prenom = prenom;
    		this.isMedecin = isMedecin;
    		this.actions = actions;
    		this.rdvs = rdvs;
    		this.lectures = lectures;
    		this.patients = patients;
    	}
     
    	public Integer getIdPersonnel() {
    		return this.idPersonnel;
    	}
     
    	public void setIdPersonnel(Integer idPersonnel) {
    		this.idPersonnel = idPersonnel;
    	}
     
    	public String getNom() {
    		return this.nom;
    	}
     
    	public void setNom(String nom) {
    		this.nom = nom;
    	}
     
    	public String getPrenom() {
    		return this.prenom;
    	}
     
    	public void setPrenom(String prenom) {
    		this.prenom = prenom;
    	}
     
    	public boolean isIsMedecin() {
    		return this.isMedecin;
    	}
     
    	public void setIsMedecin(boolean isMedecin) {
    		this.isMedecin = isMedecin;
    	}
     
    	public Set<Action> getActions() {
    		return this.actions;
    	}
     
    	public void setActions(Set<Action> actions) {
    		this.actions = actions;
    	}
     
    	public Set<Rdv> getRdvs() {
    		return this.rdvs;
    	}
     
    	public void setRdvs(Set<Rdv> rdvs) {
    		this.rdvs = rdvs;
    	}
     
    	public Set<Lecture> getLectures() {
    		return this.lectures;
    	}
     
    	public void setLectures(Set<Lecture> lectures) {
    		this.lectures = lectures;
    	}
     
    	public Set<Patient> getPatients() {
    		return this.patients;
    	}
     
    	public void setPatients(Set<Patient> patients) {
    		this.patients = patients;
    	}
     
    }
    Personnel.hbm.xml :
    Code : 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
    42
    43
    44
    45
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <!-- Generated 5 f?vr. 2015 16:33:44 by Hibernate Tools 4.0.0 -->
    <hibernate-mapping>
        <class name="objets.Personnel" table="personnel" catalog="defib">
            <id name="idPersonnel" type="java.lang.Integer">
                <column name="id_personnel" />
                <generator class="identity" />
            </id>
            <property name="nom" type="string">
                <column name="nom" not-null="true" />
            </property>
            <property name="prenom" type="string">
                <column name="prenom" not-null="true" />
            </property>
            <property name="isMedecin" type="boolean">
                <column name="is_medecin" not-null="true" />
            </property>
            <set name="actions" table="action" inverse="true" lazy="true" fetch="select">
                <key>
                    <column name="id_personnel" />
                </key>
                <one-to-many class="objets.Action" />
            </set>
            <set name="rdvs" table="rdv" inverse="true" lazy="true" fetch="select">
                <key>
                    <column name="id_personnel" />
                </key>
                <one-to-many class="objets.Rdv" />
            </set>
            <set name="lectures" table="lecture" inverse="true" lazy="true" fetch="select">
                <key>
                    <column name="id_personnel" />
                </key>
                <one-to-many class="objets.Lecture" />
            </set>
            <set name="patients" table="patient" inverse="true" lazy="true" fetch="select">
                <key>
                    <column name="id_medecin_traitant" />
                </key>
                <one-to-many class="objets.Patient" />
            </set>
        </class>
    </hibernate-mapping>
    Et l'erreur :
    Code : 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
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    mars 14, 2015 12:50:15 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
    INFO: HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
    mars 14, 2015 12:50:15 PM org.hibernate.Version logVersion
    INFO: HHH000412: Hibernate Core {4.3.6.Final}
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Environment <clinit>
    INFO: HHH000205: Loaded properties from resource hibernate.properties: {hibernate.bytecode.use_reflection_optimizer=false}
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Environment buildBytecodeProvider
    INFO: HHH000021: Bytecode provider name : javassist
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration configure
    INFO: HHH000043: Configuring from resource: hsqldb.cfg.xml
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration getConfigurationInputStream
    INFO: HHH000040: Configuration resource: hsqldb.cfg.xml
    mars 14, 2015 12:50:15 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
    WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration addResource
    INFO: HHH000221: Reading mappings from resource: objets/Action.hbm.xml
    mars 14, 2015 12:50:15 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
    WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration addResource
    INFO: HHH000221: Reading mappings from resource: objets/Cardiopathie.hbm.xml
    mars 14, 2015 12:50:15 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
    WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration addResource
    INFO: HHH000221: Reading mappings from resource: objets/Deci.hbm.xml
    mars 14, 2015 12:50:15 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
    WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration addResource
    INFO: HHH000221: Reading mappings from resource: objets/Etude.hbm.xml
    mars 14, 2015 12:50:15 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
    WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration addResource
    INFO: HHH000221: Reading mappings from resource: objets/FamilleMessage.hbm.xml
    mars 14, 2015 12:50:15 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
    WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration addResource
    INFO: HHH000221: Reading mappings from resource: objets/Lecture.hbm.xml
    mars 14, 2015 12:50:15 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
    WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration addResource
    INFO: HHH000221: Reading mappings from resource: objets/Message.hbm.xml
    mars 14, 2015 12:50:15 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
    WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration addResource
    INFO: HHH000221: Reading mappings from resource: objets/ModeleDeci.hbm.xml
    mars 14, 2015 12:50:15 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
    WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration addResource
    INFO: HHH000221: Reading mappings from resource: objets/MotifImplantation.hbm.xml
    mars 14, 2015 12:50:15 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
    WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration addResource
    INFO: HHH000221: Reading mappings from resource: objets/Patient.hbm.xml
    mars 14, 2015 12:50:15 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
    WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration addResource
    INFO: HHH000221: Reading mappings from resource: objets/Personnel.hbm.xml
    mars 14, 2015 12:50:15 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
    WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration addResource
    INFO: HHH000221: Reading mappings from resource: objets/Rdv.hbm.xml
    mars 14, 2015 12:50:15 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
    WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration addResource
    INFO: HHH000221: Reading mappings from resource: objets/TypeMessage.hbm.xml
    mars 14, 2015 12:50:15 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
    WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    mars 14, 2015 12:50:15 PM org.hibernate.cfg.Configuration doConfigure
    INFO: HHH000041: Configured SessionFactory: null
    mars 14, 2015 12:50:15 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
    WARN: HHH000402: Using Hibernate built-in connection pool (not for production use!)
    mars 14, 2015 12:50:15 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
    INFO: HHH000401: using driver [org.hsqldb.jdbcDriver] at URL [jdbc:hsqldb:file:defib]
    mars 14, 2015 12:50:15 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
    INFO: HHH000046: Connection properties: {user=sa, password=****}
    mars 14, 2015 12:50:15 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
    INFO: HHH000006: Autocommit mode: false
    mars 14, 2015 12:50:15 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
    INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
    mars 14, 2015 12:50:15 PM org.hibernate.dialect.Dialect <init>
    INFO: HHH000400: Using dialect: org.hibernate.dialect.HSQLDialect
    mars 14, 2015 12:50:15 PM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation
    INFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
    mars 14, 2015 12:50:16 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
    INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
    mars 14, 2015 12:50:16 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
    INFO: HHH000397: Using ASTQueryTranslatorFactory
    Hibernate: select this_.id_personnel as id_perso1_10_0_, this_.nom as nom2_10_0_, this_.prenom as prenom3_10_0_, this_.is_medecin as is_medec4_10_0_ from defib.personnel this_
    mars 14, 2015 12:50:16 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
    WARN: SQL Error: -227, SQLState: 3F000
    mars 14, 2015 12:50:16 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
    ERROR: invalid schema name: DEFIB in statement [select this_.id_personnel as id_perso1_10_0_, this_.nom as nom2_10_0_, this_.prenom as prenom3_10_0_, this_.is_medecin as is_medec4_10_0_ from defib.personnel this_]
    Exception in thread "AWT-EventQueue-0" org.hibernate.exception.GenericJDBCException: could not prepare statement
    	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
    	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)
    	at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:196)
    	at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:160)
    	at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1884)
    	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1861)
    	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1838)
    	at org.hibernate.loader.Loader.doQuery(Loader.java:909)
    	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354)
    	at org.hibernate.loader.Loader.doList(Loader.java:2553)
    	at org.hibernate.loader.Loader.doList(Loader.java:2539)
    	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2369)
    	at org.hibernate.loader.Loader.list(Loader.java:2364)
    	at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:126)
    	at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1682)
    	at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:380)
    	at objets.Generique.getAllAutocompletion(Generique.java:53)
    	at panneaux.pPatient.<init>(pPatient.java:223)
    	at panneaux.pPatient.ouvrir(pPatient.java:557)
    	at panneaux.FPrincipale$2.actionPerformed(FPrincipale.java:102)
    	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    	at com.jtattoo.plaf.BaseButtonListener.mouseReleased(Unknown Source)
    	at java.awt.Component.processMouseEvent(Unknown Source)
    	at javax.swing.JComponent.processMouseEvent(Unknown Source)
    	at java.awt.Component.processEvent(Unknown Source)
    	at java.awt.Container.processEvent(Unknown Source)
    	at java.awt.Component.dispatchEventImpl(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Window.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$500(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue$4.run(Unknown Source)
    	at java.awt.EventQueue$4.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.sql.SQLException: invalid schema name: DEFIB in statement [select this_.id_personnel as id_perso1_10_0_, this_.nom as nom2_10_0_, this_.prenom as prenom3_10_0_, this_.is_medecin as is_medec4_10_0_ from defib.personnel this_]
    	at org.hsqldb.jdbc.Util.throwError(Unknown Source)
    	at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
    	at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
    	at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:162)
    	at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:186)
    	... 54 more

  2. #2
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    salut,
    comment est ta structure pour la base de données?
    dans quel repertoire est elle sauvegardée, et comment s´appelle t-elle?
    Eric

  3. #3
    Membre régulier
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    676
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 676
    Points : 121
    Points
    121
    Par défaut
    Alors dans MySQL voici le schéma de la base :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    CREATE TABLE IF NOT EXISTS `personnel` (
      `id_personnel` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `nom` varchar(255) NOT NULL,
      `prenom` varchar(255) NOT NULL,
      `is_medecin` tinyint(1) NOT NULL,
      PRIMARY KEY (`id_personnel`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;
    Par contre je n'ai rien créé dans HSQL (je pensais qu'hibernate allais créer les bases de données). Néanmoins j'ai fais un essai en créant la base personnel avec HSQL Database Manager mais l'erreur persiste.

  4. #4
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    salut,
    je demandais plustot la structure de ton Projet?
    en photo si c´est possible, ou se trouve ta base de données dans HSQL, dans quelle repertoire.

    Eric

  5. #5
    Membre régulier
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    676
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 676
    Points : 121
    Points
    121
    Par défaut
    Voici l'aborsescence du projet Eclipse (c'est ce que j'ai pu prendre de plus grand) :
    Nom : Capture.PNG
Affichages : 748
Taille : 24,9 Ko
    Sinon au niveau du dossier de la base de données. Lorsque je l'ai créée avec HSQL Database Manager ça s'est mis dans C:\Users\Admin\Desktop\Logiciels\DefibExtractor\lib (le répertoire de mon projet est C:\Users\Admin\Desktop\Logiciels\DefibExtractor\ et hsqldb.jar ainsi que toutes les librairies sont dans le repertoire lib).

    Pour info HSQL Database Manager m'y a alors créé 4 fichiers dans lib :
    defib.lck
    defib.log (vide)
    defib.properties
    defib.script

  6. #6
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    donc la synthax est plutot:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <property name="connection.url">jdbc:hsqldb:C:/Users/Admin/Desktop/Logiciels/DefibExtractor/lib/defib</property>
    et dans la classe : tu devras faire plutot un :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     select .... from personnel
    Eric

  7. #7
    Membre régulier
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    676
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 676
    Points : 121
    Points
    121
    Par défaut
    C'est fait mais l'erreur perstiste.
    En fait dans pPatient je fait :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Generique.getAllAutocompletion(Personnel.class)
    qui renvoit à :
    Code : 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
    	public static List getAllAutocompletion(Class objet)
    	{
    		ArrayList retour=new ArrayList();
    		retour.add(null);
     
    		Session session = HibernateUtil.currentSession();
     
    		Criteria crit = session.createCriteria(objet)
    				.setCacheable(true)
    				.setCacheMode(CacheMode.NORMAL);
     
    		for(Object item : crit.list()) retour.add(getObjetX(item));
     
    		return retour;
    	}
    	public static Object getObjetX(Object obj)
    	{
    		if(obj instanceof Action) return new ActionX((Action) obj);
    		else if(obj instanceof Cardiopathie) return new CardiopathieX((Cardiopathie) obj);
    		else if(obj instanceof Deci) return new DeciX((Deci) obj);
    		else if(obj instanceof Etude) return new EtudeX((Etude) obj);
    		else if(obj instanceof Lecture) return new LectureX((Lecture) obj);
    		else if(obj instanceof Message) return new MessageX((Message) obj);
    		else if(obj instanceof ModeleDeci) return new ModeleDeciX((ModeleDeci) obj);
    		else if(obj instanceof MotifImplantation) return new MotifImplantationX((MotifImplantation) obj);
    		else if(obj instanceof Patient) return new PatientX((Patient) obj);
    		else if(obj instanceof Personnel) return new PersonnelX((Personnel) obj);
    		else if(obj instanceof Rdv) return new RdvX((Rdv) obj);
    		else if(obj instanceof TypeMessage) return new TypeMessageX((TypeMessage) obj);
    		return obj;
     
    	}

  8. #8
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    salut,

    un test:

    dans le xxx.cfg.xml
    Code : 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
     
     
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-configuration PUBLIC
    		"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    		"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
        <session-factory>
            <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
            <property name="connection.url">jdbc:hsqldb:file:C:/Users/Admin/Desktop/Logiciels/DefibExtractor/lib/defib</property>
            <property name="hibernate.connection.username">sa</property>
            <property name="hibernate.connection.password"></property>
            <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
     
            <!-- Montrer toutes les réquêtes générées -->
            <property name="show_sql">true</property>
     
           <mapping class="objets.Personnel"/>
     
        </session-factory>
    </hibernate-configuration>
    la classe Personnel.java tu l´annotes ainsi:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    @SuppressWarnings("serial")
    @Entity
    public class Personnel implements Serializable {
    }
    et tu me dis si ce probleme persiste.

    Eric

  9. #9
    Membre régulier
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    676
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 676
    Points : 121
    Points
    121
    Par défaut
    Ca fonctionne. Je n'ai plus l'erreur. J'ai donc replacé la fin de mon cfg.xml par
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
            <mapping class="objets.Action"/>
            <mapping class="objets.Cardiopathie"/>
            <mapping class="objets.Deci"/>
            <mapping class="objets.Etude"/>
            <mapping class="objets.FamilleMessage"/>
            <mapping class="objets.Lecture"/>
            <mapping class="objets.Message"/>
            <mapping class="objets.ModeleDeci"/>
            <mapping class="objets.MotifImplantation"/>
            <mapping class="objets.Patient"/>
            <mapping class="objets.Personnel"/>
            <mapping class="objets.Rdv"/>
            <mapping class="objets.TypeMessage"/>
    Mais maintenant quand j'essai de créer un nouveau Personnel j'ai l'erreur suivante :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Exception in thread "AWT-EventQueue-0" org.hibernate.MappingException: Unknown entity: objets.Personnel

  10. #10
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    montres nous ta classe :
    eric

  11. #11
    Membre régulier
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    676
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 676
    Points : 121
    Points
    121
    Par défaut
    Code : 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
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    package objets;
     
    // Generated 5 févr. 2015 16:33:41 by Hibernate Tools 4.0.0
     
    import java.util.HashSet;
    import java.util.Set;
     
    import org.hibernate.annotations.Entity;
     
    /**
     * Personnel generated by hbm2java
     */
     
    @Entity
    public class Personnel implements java.io.Serializable {
     
    	private Integer idPersonnel;
    	private String nom;
    	private String prenom;
    	private boolean isMedecin;
    	private Set<Action> actions = new HashSet<Action>(0);
    	private Set<Rdv> rdvs = new HashSet<Rdv>(0);
    	private Set<Lecture> lectures = new HashSet<Lecture>(0);
    	private Set<Patient> patients = new HashSet<Patient>(0);
     
    	public Personnel() {
    	}
     
    	public Personnel(String nom, String prenom, boolean isMedecin) {
    		this.nom = nom;
    		this.prenom = prenom;
    		this.isMedecin = isMedecin;
    	}
     
    	public Personnel(String nom, String prenom, boolean isMedecin,
    			Set<Action> actions, Set<Rdv> rdvs, Set<Lecture> lectures,
    			Set<Patient> patients) {
    		this.nom = nom;
    		this.prenom = prenom;
    		this.isMedecin = isMedecin;
    		this.actions = actions;
    		this.rdvs = rdvs;
    		this.lectures = lectures;
    		this.patients = patients;
    	}
     
    	public Integer getIdPersonnel() {
    		return this.idPersonnel;
    	}
     
    	public void setIdPersonnel(Integer idPersonnel) {
    		this.idPersonnel = idPersonnel;
    	}
     
    	public String getNom() {
    		return this.nom;
    	}
     
    	public void setNom(String nom) {
    		this.nom = nom;
    	}
     
    	public String getPrenom() {
    		return this.prenom;
    	}
     
    	public void setPrenom(String prenom) {
    		this.prenom = prenom;
    	}
     
    	public boolean isIsMedecin() {
    		return this.isMedecin;
    	}
     
    	public void setIsMedecin(boolean isMedecin) {
    		this.isMedecin = isMedecin;
    	}
     
    	public Set<Action> getActions() {
    		return this.actions;
    	}
     
    	public void setActions(Set<Action> actions) {
    		this.actions = actions;
    	}
     
    	public Set<Rdv> getRdvs() {
    		return this.rdvs;
    	}
     
    	public void setRdvs(Set<Rdv> rdvs) {
    		this.rdvs = rdvs;
    	}
     
    	public Set<Lecture> getLectures() {
    		return this.lectures;
    	}
     
    	public void setLectures(Set<Lecture> lectures) {
    		this.lectures = lectures;
    	}
     
    	public Set<Patient> getPatients() {
    		return this.patients;
    	}
     
    	public void setPatients(Set<Patient> patients) {
    		this.patients = patients;
    	}
     
    }

  12. #12
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    as tu fait:
    Project --> clean --> choisir le projet -- > OK

  13. #13
    Membre régulier
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    676
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 676
    Points : 121
    Points
    121
    Par défaut
    Non je viens de le faire et l'erreur est la même

  14. #14
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    peux - tu m´envoyer le projet en PM.
    Eric

  15. #15
    Membre régulier
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    676
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 676
    Points : 121
    Points
    121
    Par défaut
    Je viens de te l'envoyer. Merci c'est sympa.

  16. #16
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    salut,
    vu ce que tu m´as envoyé, cela parait claire, car il n´ya aucune table crée dans la base de données HSQLDB.
    Peux-tu m´envoyer an PM le scricpt de creation des tables, il y en a baeucoup, et ce me prendra un moment pour que je les creent.
    Eric

Discussions similaires

  1. Réponses: 9
    Dernier message: 20/11/2010, 21h51
  2. [JDBCExceptionReporter] invalid schema name . . . in statement
    Par Razors dans le forum Développement Web en Java
    Réponses: 1
    Dernier message: 11/06/2010, 00h33
  3. [D7][Crystal Report 8.5] Error 553 Invalid Parameter Name
    Par Parrain dans le forum Bases de données
    Réponses: 7
    Dernier message: 22/08/2007, 18h09
  4. [Crystal Report 8.5][D7] Error 553 Invalid Parameter Name
    Par Parrain dans le forum SAP Crystal Reports
    Réponses: 0
    Dernier message: 22/08/2007, 12h56
  5. [MySQL]DBX error : invalid translation
    Par billoum dans le forum C++Builder
    Réponses: 7
    Dernier message: 27/01/2006, 20h55

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo