-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Login issues with SQLServer
PostPosted: Thu Aug 27, 2009 2:14 pm 
Newbie

Joined: Thu Aug 27, 2009 2:12 pm
Posts: 7
Kind folks,

I am having a hell of a time connecting through Hibernate via my SQL Server. I have created this account, setup all the priveleges and was able to successfully log in using management studio. However Hibernate refuses to oblige. The following is my configuration:

Code:
           AnnotationConfiguration config = new AnnotationConfiguration();
            config.setProperty("hibernate.dialect", "org.hibernate.dialect.SQLServerDialect");
            config.setProperty("hibernate.connection.driver_class", "net.sourceforge.jtds.jdbc.Driver");
            config.setProperty("hibernate.connection.url", "jdbc:jtds:sqlserver://localhost:1433/dev");
            config.setProperty("hibernate.connection.username", "mdr_user");
            config.setProperty("hibernate.connection.password", "");
            config.setProperty("hibernate.connection.pool_size", "1");
            config.setProperty("hibernate.connection.autocommit", "true");
            config.setProperty("hibernate.cache.provider_class", "org.hibernate.cache.NoCacheProvider");
            config.setProperty("hibernate.hbm2ddl.auto", "create-drop");
            config.setProperty("hibernate.show_sql", "true");
            config.setProperty("hibernate.transaction.factory_class", "org.hibernate.transaction.JDBCTransactionFactory");
            config.setProperty("hibernate.current_session_context_class", "thread");


The trace:

Code:
Caused by: java.sql.SQLException: Login failed for user 'mdr_user'.
   at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
   at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
   at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
   at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:602)
   at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:344)
   at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
   at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
   at java.sql.DriverManager.getConnection(Unknown Source)
   at java.sql.DriverManager.getConnection(Unknown Source)
   at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
   at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)


Top
 Profile  
 
 Post subject: Re: Login issues with SQLServer
PostPosted: Thu Aug 27, 2009 3:11 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
And the password is suppsed to be blank?
Quote:
config.setProperty("hibernate.connection.password", "");

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Re: Login issues with SQLServer
PostPosted: Thu Aug 27, 2009 3:26 pm 
Newbie

Joined: Thu Aug 27, 2009 2:12 pm
Posts: 7
Yes, I tried it with a password and without a password.

Funny thing, the default sa account works, I have no idea what schema its using, but apparently its working. But when I attempt to create a custom user, its death.

In the property of the user I see something called Securables, which the sa user does not have, I wonder if that is playing a role.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.