about this package
This package contains sample applets and standalone applications that illustrate
various JDBC programming tasks with WebLogic jDriver for Informix.
You should test your connection to the Informix server with the
utility before you attempt to use the examples.
SocketApplet simply opens a socket to the port that the RDBMS
is listening on. It should be the first applet you attempt after
installation. It verifies that an Informix database server is
listening on the hostname and port number that you specify and that
your applet viewer or web browser's security manager permits opening
such a socket.
ConnectionApplet establishes a JDBC connection with the RDBMS.
It should be the second applet you attempt after installation. Use it
to verify that the JDBC driver manager can locate WebLogic jDriver for
Informix and that your connection URL is correct.
SelectApplet establishes a JDBC connection and then performs
a simple query on a system table, returning a single value. It should
be the third applet you attempt after installation. Use it to verify
that you are able to connect to the RDBMS, perform a query, and get
- login demonstrates different ways to connect to a
database, including setting explicit properties for connection in the
code and embedding properties for connection in a URL.
- records illustrates
inserting and updating records using a JDBC PreparedStatement.
- serializer shows how to insert data into an Informix BLOB
column. It demonstrates this by serializing an object, storing it
in the database, and then retrieving the object.
- simpleselect shows how
to select data and database metadata, using a Statement, a ResultSet,
and a ResultSetMetaData.
- simplesql illustrates
how to drop and create tables and add and delete rows using
a Statement and standard SQL.
- sprocs shows how to create and execute
stored procedures and get results.
- text shows how to insert string values into a column of
type TEXT and then retrieve the results.
- PreparedStatementUnicode shows how to insert Unicode streams using a prepared statement and how to retreive a Unicode stream in a result set.
how to use this package
To set up an environment for running these examples:
- Open a new shell for running these examples.
Set the CLASSPATH environment variable in that shell to include weblogic\informix4\classes.
For example (Windows NT):
$ set CLASSPATH=%CLASSPATH%;c:\weblogic\informix4\classes
Where weblogic is the directory where you installed WebLogic jDriver for
- Change the database URL, login, and password connection parameters
to correspond to your Microsoft SQL Server configuration. (For
applets, the connection URL may be in the .html file or in
the .java source file.) If you need more help, check the
section on connecting to a database in the Developers Guide, Using
WebLogic jDriver for Informix.
- Compile these examples by executing the following command in your development shell:
$ javac -d c:\weblogic\informix4\classes *.java
Where c:\weblogic is the path to the directory where you
installed WebLogic jDriver for Informix.
- To run a standalone application, execute the following command in
your development shell:
$ java examples.jdbc.informix4.className
- To run an applet, load the associated .html file into a browser.
Note that most browsers have security policies that restrict applets from
connecting to computers other than the one the applet was served from. That
means that you must install WebLogic jDriver for Informix, the webserver,
and the database server all on one computer.
For testing, you can use appletviewer, which is included in the JDK.
appletviewer does not have the security restrictions.
WebLogic jDriver for Informix for more information about applets and browser
there's more . . .
Read more about using this JDBC driver in the Developers Guide for
WebLogic jDriver for Informix, Using WebLogic jDriver for