All Examples  This Package

Class examples.jdbc.mssqlserver4.ConnectionApplet

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----examples.jdbc.mssqlserver4.ConnectionApplet

public class ConnectionApplet
extends Applet
This applet simply connects to a database. It is useful for diagnosing problems with database connections from applets, such as Java security manager restrictions and incorrect connection URLs or CLASSPATHs.

The ConnectionApplet.java source file contains very little executable code, but is is heavily commented; if you have problems running this applet, be sure to read the comments in this source file. Also, try running the SocketApplet example to test that you open a socket on the database server host machine.

To set up this example:

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

  2. In the ConnectionApplet.java file, change the database URL, login, and password connection parameters to correspond to your Microsoft SQL Server configuration. If you need more help, check the section on connecting to a database in the Developers Guide, Using WebLogic jDriver for Microsoft SQL Server.

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

    $ javac -d c:/weblogic/mssqlserver4/classes ConnectionApplet.java

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

    $ appletviewer ConnectionApplet.html


Constructor Index

 o ConnectionApplet()

Method Index

 o init()
 o paint(Graphics)

Constructors

 o ConnectionApplet
 public ConnectionApplet()

Methods

 o init
 public void init()
Overrides:
init in class Applet
 o paint
 public void paint(Graphics graphics)
Overrides:
paint in class Container

All Examples  This Package