All Examples  This Package

Class examples.jdbc.informix4.SocketApplet

examples.jdbc.informix4.SocketApplet

public class SocketApplet
This simple example applet opens a socket on a given host and port number. It is a useful first test for your database connectivity environment.

This example could fail if there is a firewall between your browser and the given host. If this is the case, look for a proxy server to help you get to the host.

There may also be a problem with the browser's security manager. Normal policy for a security manager is to let your applet only connect to the host from which it loaded. Make sure your applet is loaded from a web server on the same machine that hosts your database. Using the Java utility Appletviewer allows the applet to run without security restrictions.

To set up this example:

  1. Set up your development shell as described in Package examples.jdbc.informix4.

  2. Change connection parameters to correspond to your Informix Dynamic Server configuration. If you need more help, check the section on connecting to a database in the Developers Guide, Using WebLogic jDriver for Informix.

  3. Compile this example by executing the following command in your development shell:

    $ javac -d c:/weblogic/informix4/classes SocketApplet.java

  4. Run this example by executing the following command in your development shell:

    $ appletviewer SocketApplet.html

What should I do if this test fails?

If this test fails, try to telnet directly to the database server. From the command line type:

 telnet hostname port 

If you cannot telnet there's a chance that your database is not there or there is a firewall between you and your database. If telnet succeeds then you're probably having a problem with the Java security manager.

Author:
Copyright (c) 1997-2000 by BEA Systems, Inc. All Rights Reserved.

Constructor Index

 o SocketApplet()

Method Index

 o init()
 o paint(Graphics)

Constructors

 o SocketApplet
 public SocketApplet()

Methods

 o init
 public void init()
 o paint
 public void paint(Graphics graphics)

All Examples  This Package