Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

jdbc for sqlserver2000:Error establishing socket

  Asked By: Oscar    Date: May 24    Category: Java    Views: 1378
  

I try to connectt sqlserver2000 with jdbc driver and hibernate.
i have not any firewall and my URL is valid.i set username and
password in sqlserver2000.

my hibernate.cfg.xml:



<property
name="connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServer
Driver</property>
<property
name="connection.url">jdbc:microsoft:sqlserver://127.0.0.1:1433;Datab
aseName=FireTool</property>
<property name="connection.username">data</property>
<property name="connection.password">pass</property>



<!-- SQL dialect -->
<property
name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop
erty>

I believe my username and password is not correctly create in
sqlserver2000



Errors:


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.AbstractBatcher.prepareQueryStatement
(AbstractBatcher.java:105)
at org.hibernate.loader.Loader.prepareQueryStatement
(Loader.java:1561)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections
(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2150)
at org.hibernate.loader.Loader.listIgnoreQueryCache
(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.criteria.CriteriaLoader.list
(CriteriaLoader.java:94)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1492)
at org.hibernate.impl.CriteriaImpl.list
(CriteriaImpl.java:298)
at firetool.Connector.getSubProductWithC1(Connector.java:208)
at firetool.Frame1.<init>(Frame1.java:39)
at firetool.FireToolP.<init>(FireToolP.java:27)
at firetool.FireToolP$1.run(FireToolP.java:65)
at java.awt.event.InvocationEvent.dispatch
(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy
(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents
(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents
(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run
(EventDispatchThread.java:110)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver
for JDBC]Error establishing socket.
at com.microsoft.jdbc.base.BaseExceptions.createException
(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException
(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException
(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>
(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open
(Unknown Source)
at
com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown
Source)
at com.microsoft.jdbc.base.BaseConnection.open(Unknown
Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection
(DriverManager.java:525)
at java.sql.DriverManager.getConnection
(DriverManager.java:140)
at
org.hibernate.connection.DriverManagerConnectionProvider.getConnectio
n(DriverManagerConnectionProvider.java:110)
at org.hibernate.jdbc.ConnectionManager.openConnection
(ConnectionManager.java:315)

Share: 

 

5 Answers Found

 
Answer #1    Answered By: Luki Fischer     Answered On: May 24

Just use sql server with service pack 3 ( either sp4 would do it )
you could download it freely

 
Answer #2    Answered By: Dennis Hayes     Answered On: May 24

you must download and use service pack 3 for sql server 2000 either
you could use jTDS from sourceforge.net instead of MS driver  for jdbc

 
Answer #3    Answered By: Canan Kaya     Answered On: May 24

I believe that you should install sqlserver2000 SP3.

 
Answer #4    Answered By: Steve Boyd     Answered On: May 24

If you are using SQLServer 2000 on Windows XP SP2, you should instal
SQLServer Service Pack 3a or later.

 
Answer #5    Answered By: Raul Clark     Answered On: May 24

Download and run SQL2000-KB884525-SP4-x86-ENU.EXE from microsoft  sql server 2000 service pack4

 
Didn't find what you were looking for? Find more on jdbc for sqlserver2000:Error establishing socket Or get search suggestion and latest updates.




Tagged: