What linux user are you using to run tomcat and what user was websphere running under? I am wondering if there are some weird firewalling issues here that allow websphere to open the socket but not tomcat. It seems like a networking issue...
Of course, this might be totally the wrong direction too.
Is this the same jsp under tomcat and websphere?
James
Frank von Daak wrote:
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
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
