Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in making connectivity with SQLServerDriver

 
Mandar Velankar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am try to get around following error [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket while making JDBC connection with SQL Server 2000 service pack 3.

I am using Microsoft Windows Server 2003 Enterprise Edition service pack 2.

I installed SQL Server 2000 SP 2 and applied SP3 from microsoft site.I also

downloaded MIcrosoft SQL Server Drivers for SP3 from microsoft site.

There is no problem with SQL Server , i am able to run queries in Query Analyser.

Even I checked following support from Microsoft http://support.microsoft.com/kb/313100, but it does not help me much.

I make ensure that TCP/IP is enabled on port 1433 by checking server instance properies and using mixed mode authentication also.

I also make sure that my windows built in firewall is turned off.

I am using Tomcat 5 , added above drivers(jar files) in Tomcat classpath , i.e in WEB-INF/lib of my web application.

here is my connection bean code

package com;

import java.sql.*;
import java.io.*;
import java.lang.*;

public class sqlAccessBean
{

String dbURL = "jdbc:microsoft:sqlserver://localhost:1433;databaseName=master;";
String dbDriver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String username;
String password;
public Connection dbCon;

public sqlAccessBean()
{
super();
}

public boolean connect(String module) throws ClassNotFoundException,SQLException
{
Class.forName(dbDriver);
dbCon = DriverManager.getConnection(dbURL,"sa","sa");
return true;
}
}

I am using above bean in my jsp and calling connect() method .

I am beginner with SQL Server connectivity, can anybody help me?

Thanks you a lot, waiting for your reply.

Regards,

Mandar S. Velankar
 
Scott Selikoff
author
Saloon Keeper
Posts: 4032
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a connection issue, either your connection string is incorrect or there's a firewall/port issue blocking the connection.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic