• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Error connecting to MSSQL Server from Hibernate

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sushma Sharma
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
jdbc:microsoft:sqlserver://localhost:1433;=master;selectMethod=cursor

typo???
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Villains always have antidotes. They're funny that way. Here's an antidote disguised as a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic