Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

somebody come in and help me check this error

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I installed SQL sever 2000 in my computer,but i doesn't connected it with the follow TestJDBC class:
---------------------------------------------------------------------------
import java.sql.*;


public class TestJDBC{
public static void main(String[] args){
try {

String url =
"jdbc:microsoft:sqlserver://localhost:1433;databaseName=jiaotong";
String username = "java";
String password = "java";
Connection conn = null;
System.out.println("1");
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
System.out.println("2");
conn = DriverManager.getConnection(url, username, password);
System.out.println("2" + conn);
Statement stmt = conn.createStatement() ;
//String strSql = " insert into cat values('1','jdbc','m',0) " ;
// stmt.execute( strSql );

stmt.close();
conn.close();

}
catch (Exception e) {
e.printStackTrace();
}

}
}
--------------------------------------------------------------------------
and the errors are follow:
D:\>java TestJDBC
1
2
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establis
hing 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 Sou
rce)
at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown S
ource)
at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at TestJDBC.main(TestJDBC.java:18)

D:\>
-------------------------------------------------------------------------
set sql_home=D:\sql
set CLASSPATH=%classpath%;%sql_home%\mssqlserver.jar;%sql_home%\msutil.jar;%sql_home%\msbase.jar;

plase give me a help, thanks
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
pls visit the link may be it will help you
http://support.microsoft.com/default.aspx?scid=kb;en-us;313178
 
lei zhang
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you praveen k










jack
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic