--------------71A64B5AA97D02E48C994E46
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I have the following test setup
172.17.50.244 is a NT 4.0 SP3 box running IIS 3.0 and SQL Server 6.5
listening on port 1433 and is
the intranet server
172.17.50.249 is a NT 4.0 SP3 box running Microsoft Proxy Server 2.0
which provides internet
connections for workstations on these networks 172.17.52.* and
172.17.51.*
I'm trying the following applet which uses Connect Software's type 4
JDBC driver:
(The applet resides on 172.17.50.244 along with Connect Software's JDBC
drivers.
The URL that I use to access the page is
http://172.17.50.244/jdbc/socketapplet.html)
import jdbc.sql.*; // FIXME: jdbc.sql or java.sql
import java.applet.*; // applet class
import java.awt.*; // windowing toolkit
import java.io.*; // I/O classes and exceptions
import java.net.*; // TCP/IP libraries
public class ConnectionApplet extends Applet
{
String url = "jdbc:ff-microsoft://172.17.50.244:1433";// FIXME:
jdbc:ff-microsoft://hostname:portnumber
// String url = "jdbc:ff-sybase://gionata:5000"; // FIXME:
jdbc:ff-sybase://hostname:portnumber
String login = "sa"; // FIXME:
your login (for system administrator use sa)
String password = ""; // FIXME:
your password
public void init()
{
System.getProperties().put("proxySet", "true");
System.getProperties().put("proxyHost", "172.17.50.249");
System.getProperties().put("proxyPort", "80");
try
{
Class.forName("connect.sybase.SybaseDriver"); //
loads class by name and registers with driver manager
Driver driver1 = new
connect.sybase.SybaseDriver(); // also try creating a
class (redundant but useful for demo)
Class.forName("connect.microsoft.MicrosoftDriver");
Driver driver2 = new connect.microsoft.MicrosoftDriver();
Connection connection =
DriverManager.getConnection(url,login,password);
message = "Connection was opened with " + url; //
connection was opened succesfully
connection.close(); // close the
connection (and its socket)
}
catch(ClassNotFoundException ex)
{
message = "Exception: Driver wasn't found, check classpath:
" + ex;
}
catch(Exception ex)
{
message = "Exception while opening the connection: " + ex;
ex.printStackTrace(System.out); // prints
the stack trace which shows where the problem is
}
catch(Error err)
{
message = "Error while opening the connection: " + err;
err.printStackTrace(System.out); // prints
the stack trace which shows where the problem is
}
System.out.println(message);
repaint();
}
public void paint(Graphics graphics)
{
graphics.drawString(message,10,20);
}
String message = "";
}
A) When I connect using Netscape Versions 3.0 and 4.x I face no problems
at all.
B) When I connect using IE 3.x and 4.x with the following configuration
- Connect through a proxy server is enabled
- Do not use proxy server for local intranets enabled
- 172.17.50.244 is entered in the proxy exclusion list
(P.S - The proxy server has Windows NT Challenge/Response enabled
and is configured
to allow inbound connections on port 1433)
I get a message like this:
"Exception while opening the socket on 172.17.50.244:1433
java.net.ConnectException: Connection refused"
C) When I connect using IE 3.x and 4.x without enabling the proxy I face
no problems at all
1) Is it possible for a JDBC applet to be accessed through a proxy
server ?
2) Will using the FastForward Security proxy make any sense since IIS
which is serving the applet
and SQL Server reside on the same host i.e 172.17.50.244 ?
Vinod Subramaniam,
Systems Executive,
NIIT Limited,
F-90 /2 Okhla Ph-I
New Delhi
INDIA
Ph: 91-11-6817385-88
Fax: 91-11-6817384
E-mail: vin...@delf90.niit.co.in
web: http://www.niit.com
personal: http://www.geocities.com/SiliconValley/Way/2219/
http://www.freeyellow.com/members/luckylipps/
---------------------------------------------------------------------------
A Peregrine for a Prince,
A Goshawk for a Bishop,
A Eagle for a Emperor,
A Falcon for a King,
A Kestrel for a Knave.
---------------------------------------------------------------------------
--------------71A64B5AA97D02E48C994E46
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
<TT><FONT SIZE=-1>I have the following test setup</FONT></TT><TT><FONT SIZE=-1></FONT></TT>
<P><TT><FONT SIZE=-1>172.17.50.244 is a NT 4.0 SP3 box running IIS 3.0
and SQL Server 6.5 listening on port 1433 and is</FONT></TT>
<BR><TT><FONT SIZE=-1>the intranet server</FONT></TT><TT><FONT SIZE=-1></FONT></TT>
<P><TT><FONT SIZE=-1>172.17.50.249 is a NT 4.0 SP3 box running Microsoft
Proxy Server 2.0 which provides internet</FONT></TT>
<BR><TT><FONT SIZE=-1>connections for workstations on these networks 172.17.52.*
and 172.17.51.*</FONT></TT><TT><FONT SIZE=-1></FONT></TT>
<P><TT><FONT SIZE=-1>I'm trying the following applet which uses Connect
Software's type 4 JDBC driver:</FONT></TT>
<BR><TT><FONT SIZE=-1>(The applet resides on 172.17.50.244 along with Connect
Software's JDBC drivers.</FONT></TT>
<BR><TT><FONT SIZE=-1>The URL that I use to access the page is <A HREF="http://172.17.50.244/jdbc/socketapplet.html">http://172.17.50.244/jdbc/socketapplet.html</A>)</FONT></TT><TT><FONT SIZE=-1></FONT></TT>
<P><TT><FONT SIZE=-1>import jdbc.sql.*;
// FIXME: jdbc.sql or java.sql</FONT></TT>
<BR><TT><FONT SIZE=-1>import java.applet.*;
// applet class</FONT></TT>
<BR><TT><FONT SIZE=-1>import java.awt.*;
// windowing toolkit</FONT></TT>
<BR><TT><FONT SIZE=-1>import java.io.*;
// I/O classes and exceptions</FONT></TT>
<BR><TT><FONT SIZE=-1>import java.net.*;
// TCP/IP libraries</FONT></TT><TT><FONT SIZE=-1></FONT></TT>
<P><TT><FONT SIZE=-1>public class ConnectionApplet extends Applet</FONT></TT>
<BR><TT><FONT SIZE=-1>{</FONT></TT>
<BR><TT><FONT SIZE=-1> </FONT></TT>
<BR><TT><FONT SIZE=-1> String url = "jdbc:ff-microsoft://172.17.50.244:1433";//
FIXME: jdbc:ff-microsoft://hostname:portnumber</FONT></TT>
<BR><TT><FONT SIZE=-1> // String url = "jdbc:ff-sybase://gionata:5000";
// FIXME: jdbc:ff-sybase://hostname:portnumber</FONT></TT>
<BR><TT><FONT SIZE=-1> String login = "sa";
// FIXME: your login (for system administrator use sa)</FONT></TT>
<BR><TT><FONT SIZE=-1> String password = "";
// FIXME: your password</FONT></TT><TT><FONT SIZE=-1></FONT></TT>
<P><TT><FONT SIZE=-1> public void init()</FONT></TT>
<BR><TT><FONT SIZE=-1> {</FONT></TT>
<BR><TT><FONT SIZE=-1> System.getProperties().put("proxySet",
"true");</FONT></TT>
<BR><TT><FONT SIZE=-1> System.getProperties().put("proxyHost",
"172.17.50.249");</FONT></TT>
<BR><TT><FONT SIZE=-1> System.getProperties().put("proxyPort",
"80");</FONT></TT>
<BR><TT><FONT SIZE=-1> try</FONT></TT>
<BR><TT><FONT SIZE=-1> {</FONT></TT><TT><FONT SIZE=-1></FONT></TT>
<P><TT><FONT SIZE=-1>
Class.forName("connect.sybase.SybaseDriver");
// loads class by name and registers with driver manager</FONT></TT>
<BR><TT><FONT SIZE=-1>
Driver driver1 = new connect.sybase.SybaseDriver();
// also try creating a class (redundant but useful for demo)</FONT></TT>
<BR><TT><FONT SIZE=-1>
Class.forName("connect.microsoft.MicrosoftDriver");</FONT></TT>
<BR><TT><FONT SIZE=-1>
Driver driver2 = new connect.microsoft.MicrosoftDriver();</FONT></TT><TT><FONT SIZE=-1></FONT></TT>
<P><TT><FONT SIZE=-1>
Connection connection = DriverManager.getConnection(url,login,password);</FONT></TT>
<BR><TT><FONT SIZE=-1>
message = "Connection was opened with " + url; // connection was
opened succesfully</FONT></TT>
...
read more »