473,670 Members | 2,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.get SystemClassLoad er().

loadClass("com. microsoft.jdbc. sqlserver.SQLSe rverDriver");

DriverManager.r egisterDriver(( Driver) dbClass.newInst ance() );

Connection conn =
DriverManager.g etConnection("j dbc:microsoft:s qlserver://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.SQLExc eption: [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
3 8179
Hi ... I also tried the following connection string which I made after
looking at other peoples problems.

jdbc:microsoft: sqlserver://EBBY/VSdotNET:1433;D atabaseName=Ebb y");

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

Jul 23 '05 #2
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.goo glegroups.com.. .
Hi ... I also tried the following connection string which I made after
looking at other peoples problems.

jdbc:microsoft: sqlserver://EBBY/VSdotNET:1433;D atabaseName=Ebb y");

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

Jul 23 '05 #3
(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.g etConnection("j dbc:microsoft:s qlserver://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****@sommarsk og.se

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
11774
by: Keith Norris | last post by:
I am having a problem connecting to my SQL Server with the following ASP code: set cn = server.createobject("adodb.connection") cn.connectionstring = "Provider=sqloledb; data source=midatlanticus; Integrated Security=SSPI" cn.open But, if I use the same connection string in a VB program, I connect successfully. The VB code that works successfully is as follows:
4
1247
by: Roy Gourgi | last post by:
Hi, I just install MSDE 2000 on my computer and I am trying to make a connection with the server but it does not seem to be working. What am I doing wrong in the code below? When I open my Server Explorer I see Data Connections and Servers. Do I have to make a physical connection of some sort first? In the Servers section, I see that it automatically created a SQL server by the name REBORN where I created a database called royDB. Am I...
7
2746
by: Reza | last post by:
Hello The project was working, where I had a domain user registered in the database as a user, and I used that user to connect the datebase. Everything was fine and it was working, then when I moved the project to the production servers - database server and web server. Following that all the users are failing to connct to database, getting this message "login failed for user 'username' I am getting the user with property identity and it...
18
1977
by: Jon Delano | last post by:
Hey all I am building a new computer. I have Windows XP Pro with SP2 and all the updates. I installed VS 2003. Then copied a project from my old computer to the new one. When I try and run the project .. it errors out saying it "sql server does not exist or access denied"
4
1813
by: IcedCrow | last post by:
I have stumbled upon a serious problem and I hope someone can help me out. I have programmed a web service in VB.NET. When I use integrated security for the piece, of course it does not use my log in but the ASP log in. No problem. I get an error. So first in experiment I try and use the sa account. I
6
1236
by: Backwards | last post by:
I'm using visual studio 2005 and SQL 2000, trying to connect to a sql database as a differnent user. Here is my current connection string that is using my own NT login: Dim message As String = "Data Source=" + Me.ComboBox1.Text.ToString() + ";Initial Catalog=Store;Integrated Security=SSPI" Dim sql As New SqlClient.SqlConnection(message)
3
13350
by: Ted | last post by:
In WSAT, I get the following error when trying to set up my provider: Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider. On Windows XP Pro, I am using MS Visual Studio 2005, and I am using the developer's edition of...
4
2212
by: Brad Isaacs | last post by:
I am working with ASP.NET 2.0 and using an SQL Server 2000 database. I am using Visual Studio 2005 and developing on my Local machine. I am working with Login controls ASP.Configuration, I wanted to move my work and needed to place it on the server. Using VS 2005 , went to BUILD -Publish Web Site Checked the box for :: Alow this precompiled site to be updatable.
7
4739
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
We have one connection string to our SQL Server 2000: "Data Source=WORKAPP;Initial Catalog=Parts_Data;Integrated Security=SSPI;User ID=public;Password=public"; Everyone can connect to the database in our plant except for the Restricted Users. Why can't the Restricted Users access this? How can we get around it?
0
8386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8903
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8814
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8592
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7419
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5684
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2042
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.