All Examples  This Package

Class examples.jdbc.mssqlserver4.sqlBrowser

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

public class sqlBrowser
extends Applet
This applet allows you to connect to a database server, enter SQL queries, and see the results in a browser.

If the applet does not connect to your database, make sure you change the 'connection' parameter in sqlBrowser.html to specify your SQL Server host. The connection URL tells the applet which database on which host you're connecting to. Also make sure you specify a valid login and password on your server.

To set up this example:

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

  2. In the sqlBrowser.html 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 sqlBrowser.java

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

    $ appletviewer sqlBrowser.html


Constructor Index

 o sqlBrowser()

Method Index

 o action(Event, Object)
Handle button events, including executing SQL user enters and displaying results.
 o clearLog()
Clear the server panel in the applet.
 o init()
Set up awt objects in the browser, get database connection parameters from the .html file, and connect to the database.
 o log(String)
Append text to the server panel in the applet.

Constructors

 o sqlBrowser
 public sqlBrowser()

Methods

 o init
 public synchronized void init()
Set up awt objects in the browser, get database connection parameters from the .html file, and connect to the database.

Overrides:
init in class Applet
 o action
 public synchronized boolean action(Event iEvent,
                                    Object iArgument)
Handle button events, including executing SQL user enters and displaying results.

Parameters:
iEvent, - the button event.
iArgument, - the button label.
Overrides:
action in class Component
 o clearLog
 public synchronized void clearLog()
Clear the server panel in the applet.

 o log
 public synchronized void log(String s)
Append text to the server panel in the applet.

Parameters:
s, - the string to append to the server panel.

All Examples  This Package