By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,569 Members | 1,394 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,569 IT Pros & Developers. It's quick & easy.

Help with java connection to MS SQL 2000 with windows integrated security

P: n/a
Hi , I am trying to connect to MS Sql server 2000 from Java (1.4.2 /
1.5 ). I installed my Sql Server(8.00.382) from the one supplied with
VS.NET 2001. When I installed it on my laptop it did not ask me for a
user name and password. After install when I re-started my machine I
see the server started up with a green light. Now when I connect to the
server from VS.NET it works fine. This is because VS uses windows
integrated security. I now need to connect using Java , so I downloaded
the microsoft drivers for SQL2000-JDBC sp3 from the microsoft site. I
added the jar files to my Java project classpath. I manage to register
the driver in java :

Class dbClass = ClassLoader.getSystemClassLoader().

loadClass("com.microsoft.jdbc.sqlserver.SQLServerD river");

DriverManager.registerDriver((Driver) dbClass.newInstance() );

Connection conn =
DriverManager.getConnection("jdbc:microsoft:sqlser ver://localhost:1433;_
integrated security=SSPI");
but cannot seem to get a connection as it gives an SQLException saying
that it is unable to connect:

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error
establishing socket.
I cant seem to figure it out.Can some one help ??

I am a newbie to sqlserver so couldnt quite figure out how to change
admin password or create a new user with the tools provided with this
version of sql (SQL Server Desktop Engine).

Any help will be appreciated.

Ebby

Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi ... I also tried the following connection string which I made after
looking at other peoples problems.

jdbc:microsoft:sqlserver://EBBY/VSdotNET:1433;DatabaseName=Ebby");

where EBBY is the server name
VSdotNET the instance name
Ebby the database name

Jul 23 '05 #2

P: n/a
Hi

You may want to check out
http://support.microsoft.com/default...b;en-us;313100

The following would imply that a names instance would require a different
port (or possibly an alias) to connect
http://support.microsoft.com/default...b;en-us;313225

John
<eb****************@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Hi ... I also tried the following connection string which I made after
looking at other peoples problems.

jdbc:microsoft:sqlserver://EBBY/VSdotNET:1433;DatabaseName=Ebby");

where EBBY is the server name
VSdotNET the instance name
Ebby the database name

Jul 23 '05 #3

P: n/a
(eb****************@gmail.com) writes:
Hi , I am trying to connect to MS Sql server 2000 from Java (1.4.2 /
1.5 ). I installed my Sql Server(8.00.382) from the one supplied with
VS.NET 2001.
8.00.382 is SQL 2000 SP1. The current service pack of SQL 2000 is SP3 (and
SP4 is in beta). I strongly recommend you to upgrade to SP3, as SP3
has a fix for the Slammer worm which could attack your SQL Server if
you were to expose it on the Internet.
Connection conn =
DriverManager.getConnection("jdbc:microsoft:sqlser ver://localhost:1433;_
integrated security=SSPI");


1433 is normally the port for the default instance, and apparently you have
a named instance. Check out the links posted by John, and see if they help.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.