Question: Are you certain that SQL Server is listening on port 1433? I've
seen it using port 1141. Use the SQL Server network utility to check the
TCP port.
----- Original Message -----
From: "Frank von Daak" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 30, 2003 10:51 AM
Subject: Tomcat and MsSQL
> Hi,
>
>
> maybe, someone of you can help me...
>
> I try to port a webapplication from asp to java...
>
> First, I have used Websphere for this and everything worked ok, but then I
> decided to use tomcat4 (both under debian-linux)
>
> My problem is the connection to a MSSQL-Database.
>
> As JDBC-Driver I'm using the "Microsoft SQL Server 2000 Driver for JDBC",
> which has an official linux-support. And I cn say, that it is working very
> well with websphere...
>
> When I use the same jsp-files under tomcat, I get the following error,
when
> trying to connect the sql-server:
>
> [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
>
>
> I have copied the 3 files "msbase.jar", "mssqlserver.jar" and "msutil.jar"
to
> $CATALINA_HOME/common/lib and it seems, that tomcat can find them (as the
> error message says)
>
> Here is the code, that I use to connect to the database:
>
> --------------------------------------------------
>
> <%@ page language="java" import="javax.sql.DataSource,java.sql.*"%>
> <%
>
> Connection db_con;
> Statement db;
>
> try {
> Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
> } catch (ClassNotFoundException e) {
> out.println("<h1>Der Datenbanktreiber konnte nicht gefunden werden:" + e
+
> e.getMessage() + "</h1>" );
> }
>
> String con = "jdbc:microsoft:sqlserver://192.168.0.199:1433;User=sa;
> Password=bla;DatabaseName=testdb";
>
> try {
> db_con = DriverManager.getConnection (con);
> } catch ( SQLException se ) {
> out.println("Exception...(" + se.getMessage() + ")<br>-->");
> }
> %>
>
> ------------------------------------------------------
>
>
> What do I have to do, to get it working with tomcat ?
>
>
> Thank you very much for your help !!!
>
> Greetings,
> Frank
>
> --
> Name: Frank von Daak
> eMail: [EMAIL PROTECTED] Homepage: http://www.kpage.de
> eMail: [EMAIL PROTECTED] Homepage: http://www.linux-dev.de
> "If Bill Gates had a nickel for every time Windows crashed...
> - oh wait, he does."
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]