aspose file tools*
The moose likes Object Relational Mapping and the fly likes Error connecting to MSSQL Server from Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Error connecting to MSSQL Server from Hibernate" Watch "Error connecting to MSSQL Server from Hibernate" New topic
Author

Error connecting to MSSQL Server from Hibernate

Sushma Sharma
Ranch Hand

Joined: Jun 02, 2005
Posts: 139
HI All,

I am newbie to Hibernate and i m trying one of tutorials. problem is that I am getting the following error when I run my application



I have specified all the details needed to connect to MS SQL Server in hibernate.cfg.xml and hibernate.properties both. below is the code for both

hibernate.cfg.xml



hibernate.proerties


Please tell me what am I doing wrong....
Any suggestions are welcome

Regards

Sushma
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Do you have a login defined in MSSQL called 'Administrator' which requires no password? This seems unlikely, since as far as I'm aware you can't define a login with no password.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Sushma Sharma
Ranch Hand

Joined: Jun 02, 2005
Posts: 139
yes, my username id Administrator and it doesn't have a password. Actually, its my windows password and I am using the windows login for MS SQL Server also.... is that a problem? I am able to connect to MS SQL Server. I am not sure why I am getting

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket


Is this because of password is empty?
I'll try creating some other user and try with that...
Pavan Tummala
Ranch Hand

Joined: Dec 25, 2004
Posts: 74
jdbc:microsoft:sqlserver://localhost:1433;=master;selectMethod=cursor

typo???


If Java had true garbage collection, most programs would delete themselves upon execution -- Robert Sewell
Hiroshi Tominaga
Greenhorn

Joined: Apr 21, 2005
Posts: 29
Hi,
Did you check if the SQL servers has the 1433 port available?
Try the following command: telnet <serverName> 1433

Check in the sqlServer if the TCP/IP protocol is enable.
Check if the Database is started.
Check for the domain of the Database, if you are in the same domain.


best regards


SCJP 1.4, <br />IBM Certified System Administrator Websphere Application Server 5.0, IBM Certified DB2 UDB Database Associate
samdeep aarzoo
Ranch Hand

Joined: Jun 09, 2005
Posts: 160
telnet <serverName> 1433
what is the use of this command at telenet

i write this on console
and i got only cursor blinks what does this show
what is the use of this command
and what we are checking through this
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Originally posted by Sushma Sharma:
yes, my username id Administrator and it doesn't have a password. Actually, its my windows password and I am using the windows login for MS SQL Server also.... is that a problem?

Yes it is a problem. You need to change the authentication method your MSSQL instance uses to "SQL Server and Windows" and connect to it with a database account, rather than using Windows integrated authentication.
Sham Grandhe
Ranch Hand

Joined: Dec 16, 2003
Posts: 73
hey use the below link to change your SQL Server Login setting from window authentication to SQL Server and Window Authentication

http://www-1.ibm.com/support/docview.wss?uid=swg21119906

this might help your resolve the SQL Server Error 18452
Sham Grandhe
Ranch Hand

Joined: Dec 16, 2003
Posts: 73
Originally posted by sandeep mittal:
telnet <serverName> 1433
what is the use of this command at telenet

i write this on console
and i got only cursor blinks what does this show
what is the use of this command
and what we are checking through this


waw check the above mentioned steps you should be able to resolve the issue.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Please pay attention to the date of posts. It is very unlikely that Sushma Sharma is still waiting for an answer to a question they posted almost three years ago.

Also:

Yes it is a problem. You need to change the authentication method your MSSQL instance uses to "SQL Server and Windows" and connect to it with a database account, rather than using Windows integrated authentication

This is not true any more. Most SQL Server JDBC drivers support NTLM these days.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error connecting to MSSQL Server from Hibernate