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 :

[Hibernate] Connexion SQL Server authentification windows


Sujet :

Hibernate Java

  1. #1
    Membre régulier Avatar de Michel38
    Homme Profil pro
    Inscrit en
    Juin 2005
    Messages
    218
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Juin 2005
    Messages : 218
    Points : 113
    Points
    113
    Par défaut [Hibernate] Connexion SQL Server authentification windows
    Bonjour,
    J'ai configuré SQL Server pour que je puisse me connecter sur le server en authentification SQL OU Windows.
    Seulement, les essais que j'ai fait marchent en authentification SQL, mais ne marchent pas en authentification Windows...... faut il faire quelque chose de spécial ????
    Voilà mon hibernate.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
     
    <?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">net.sourceforge.jtds.jdbc.Driver</property>
            <property name="hibernate.connection.password">password</property>
            <property name="hibernate.connection.url">jdbc:jtds:sqlserver://dev01/isocial</property>
            <!-- property name="hibernate.connection.url">jdbc:jtds:sqlserver://192.168.1.12:1433/isocial</property-->
            <property name="hibernate.connection.username">MichelXXXXXX</property>
            <property name="hibernate.default_catalog">isocial</property>
            <property name="hibernate.default_schema">dbo</property>
            <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
                    <!-- Mapping files -->
            <mapping resource="isocial/hibernate/Entreprise.hbm.xml"/>
            <mapping resource="isocial/hibernate/Salarie.hbm.xml"/>
            <mapping resource="isocial/hibernate/Divers.hbm.xml"/>
     
        </session-factory>
    </hibernate-configuration>
    et mon message d'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
    Exception in thread "main" org.hibernate.exception.GenericJDBCException: Cannot open connection
    	at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
    	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
    	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
    	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:318)
    	at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:109)
    	at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:137)
    	at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
    	at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1262)
    	at Lecture.methodealacon(Lecture.java:25)
    	at Lecture.main(Lecture.java:79)
    Caused by: java.sql.SQLException: Échec de la connexion de l'utilisateur 'MichelXXXXXX'.
    	at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
    	at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
    	at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
    	at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:599)
    	at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:331)
    	at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
    	at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
    	at java.sql.DriverManager.getConnection(DriverManager.java:525)
    	at java.sql.DriverManager.getConnection(DriverManager.java:140)
    	at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
    	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:315)
    	... 6 more
    Merci d'avance.

  2. #2
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2005
    Messages
    274
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 274
    Points : 307
    Points
    307
    Par défaut
    Bonjour,

    Essaie de préciser le nom du domaine dans l'url de connexion et en retirant les propriétés hibernate.connection.password et hibernate.connection.username



    <property name="hibernate.connection.url">jdbc:jtds:sqlserver://dev01/isocial;domain=domaine </property>

  3. #3
    Membre régulier Avatar de Michel38
    Homme Profil pro
    Inscrit en
    Juin 2005
    Messages
    218
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Juin 2005
    Messages : 218
    Points : 113
    Points
    113
    Par défaut
    Et bien non, rien n'y fait...
    j'ai le message :
    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
    Exception in thread "main" org.hibernate.exception.JDBCConnectionException: Cannot open connection
    	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:72)
    	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
    	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:318)
    	at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:109)
    	at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:137)
    	at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
    	at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1262)
    	at Lecture.methodealacon(Lecture.java:25)
    	at Lecture.main(Lecture.java:79)
    Caused by: java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
    	at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:611)
    	at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:331)
    	at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
    	at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
    	at java.sql.DriverManager.getConnection(DriverManager.java:525)
    	at java.sql.DriverManager.getConnection(DriverManager.java:140)
    	at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
    	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:315)
    	... 6 more
    Caused by: java.io.IOException: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
    	at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1894)
    	at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:584)
    	... 13 more

  4. #4
    Membre régulier Avatar de Michel38
    Homme Profil pro
    Inscrit en
    Juin 2005
    Messages
    218
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Juin 2005
    Messages : 218
    Points : 113
    Points
    113
    Par défaut
    Par contre, en laissant hibernate.connection.password et hibernate.connection.username ça passe.
    Donc merci infiniment, j'ai réussi à avancer.....

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [SGBD] Connexion de Eclipse (Hibernate) vers SQL Server
    Par Michel38 dans le forum Hibernate
    Réponses: 4
    Dernier message: 11/03/2012, 16h39
  2. connexion sql server avec authentification windows
    Par sehing7 dans le forum VB 6 et antérieur
    Réponses: 11
    Dernier message: 21/04/2010, 12h20
  3. sql server authentification windows
    Par stephyugh dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 28/03/2008, 19h19
  4. Réponses: 1
    Dernier message: 12/02/2008, 17h25
  5. connexion à sql server avec l'authentification windouws
    Par kadiato dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 30/04/2007, 16h17

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