Sql Server 2000 JDBC Connection fail | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Sql Server 2000 JDBC Connection fail

Hi…<br /><br />Iam new to Sql Server 2000 JDBC.i have installed that sofeware in my system..and also setted classpath in Environment Variables..but still iam getting same error..could anyone please help me..iam facing this problem from 4 days…i tried alot for this…<br />Please reply me as soon as possible…<br /><br />My java Code is….<br /><br />import java.sql.*;<br />public class SqlTest <br />{<br /> public SqlTest() throws Exception <br />{<br /> // DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());<br /> Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");<br /> Connection conn = DriverManager.getConnection("jdbc:microsoft<img src=’/community/emoticons/emotion-7.gif’ alt=’:s’ />qlserver://localhost:1433","sa","bushel90");<br /> if (conn!= null) <br />{ System.out.println("Successfully connected");<br /> }<br /> } <br />public static void main (String args[]) throws Exception<br /> {<br /> SqlTest test = new SqlTest();<br /> }<br />}<br /><br />and My Error is….<br /><br />Exception in thread "main" java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.<br /> at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)<br /> at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)<br /> at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)<br /> at com.microsoft.jdbc.sqlserver.tds.TDSConnection.&lt;init&gt;(Unknown Source)<br /> at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)<br /> at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)<br /> at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)<br /> at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)<br /> at java.sql.DriverManager.getConnection(Unknown Source)<br /> at java.sql.DriverManager.getConnection(Unknown Source)<br /> at SqlTest.&lt;init&gt;(SqlTest.java:15)<br /> at SqlTest.main(SqlTest.java:25)<br /><br /><br />Thank You <br />Cheers<br />
Check the KBAhttp://support.microsoft.com/default.aspx?scid=kb;en-us;313178 and related forumshttp://forum.java.sun.com/thread.jspa?threadID=419214 for more information. Satya SKJ
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
check this and try http://support.microsoft.com/default.aspx?scid=kb;en-us;313100
http://swforum.sun.com/jive/thread.jspa?threadID=45730&messageID=130277
http://www.datadirect.com/products/jdbc/overview/index.ssp

SURYA


similar posting in sqlteam, chk this also if it is useful.. http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=58179

SURYA


]]>