I am trying to get JConnect 2.0 to work an a Netscape Enterprise server
connected to SQLServer for NT using jdk1.1.1 and jsdk. I have
successfully compiled connected and queried from the command line, but
am having troubles with servlets. My servlets compile, they even execute
a few println statements and set the system properties. However, the
connection fails and it is the same connection information I used in the
command line program.

I noticed that the catch{} that was executing was the java exception not
the sql exception.
Do Servlets use jConnect the same way?
Could Enterprise be configured incorrectly?
Java is enabled and servlets work, just not jConnect.



Any Ideas?
Thanks,
Neil



Below is the code.



___________________
From the command line I execute "d:\jdk1.1.1\bin\java Neil2"
successfully.

Neil2.java starts like this:


import java.io.*;
import java.sql.*;
import com.sybase.utils.Debug;
import com.sybase.jdbc.Const;
import java.util.*;
public class Neil2
{
public static void main(String args[])
{
try
{
System.out.println("<HEAD><TITLE> JDBC Servlet Output
</TITLE></HEAD><BODY>");
System.out.println("got to 1");
try
{
System.out.println("trying to use class for name");
Class.forName("com.sybase.jdbc.SybDriver");
System.out.println("class for name");
Properties props = new Properties();
props.put("user","sa");
props.put("password", "");
System.out.println("<br>ready to make a connection");
Connection con
=DriverManager.getConnection("jdbc:sybase:Tds:TRANTOR:5000", props);
System.out.println("got to 3");
.
.
.
___________________

I am trying to do the same thing with my servlet, it gets as far as
"<br>ready to make a connection" before terminating.
It looks like this:

import java.io.*;
import java.sql.*;
import com.sybase.utils.Debug;
import com.sybase.jdbc.Const;
import java.util.*;
import java.servlet.*;
import java.servlet.http.*;

public class Neil1 extends GenericServlet
{

public void service(ServletRequest req, ServletResponse res)
throws ServletException, IOException
{
res.setContentType("text/html");
ServletOutputStream out = res.getOutputStream();
out.println("<HEAD><TITLE> JDBC Servlet Output </TITLE></HEAD><BODY>");
out.println("got to 1");

try
{
out.println("trying to use class for name");
Class.forName("com.sybase.jdbc.SybDriver");
out.println("class for name");
Properties props = new Properties();
props.put("user","sa");
props.put("password", "");


out.println("<br>ready to make a connection");
Connection con
=DriverManager.getConnection("jdbc:sybase:Tds:TRANTOR:5000",
props); out.println("got to 3");
.
.
.
___________________