Home |
Previous Page | Next Page Appendix A. Sample Code Files > Summary of Available Examples >
Each example has its own subdirectory. Most of the directories
include a README file that describes the
examples and how to run them.
- Directory
- Type of Examples
- basic
- Examples that show common database operations
- clob-blob
- Examples that use smart large objects
- udt-distinct
- Examples that use opaque and DISTINCT data types
(there are additional examples using opaque types in Examples in the udtudrmgr Directory)
- complex-types
- Examples that use row and collection types
- rmi
- An example using Remote Method Invocation
- stores7
- The stores7 demonstration database
- pickaseat
- An
example using DataSource objects
- connection-pool
- Examples that illustrate using a connection pool
- proxy
- Examples that illustrate using an HTTP proxy server
- xml
- Examples that illustrate storing and retrieving XML documents
- hdr
- Examples that illustrate using High-Availability Data Replication
Examples in the basic Directory
The following table lists the files in the basic directory.
- Demo Program Name
- Description
- autofree.java
- Shows
how to use the IFX_AUTOFREE environment variable
- BatchUpdate.java
- Shows how to send batch updates to the server
- ByteType.java
- Shows how to insert into and select from a table that contains
a column of data type BYTE
- CallOut1.java
- Executes a C function that has an OUT parameter
using CallableStatement methods
- CallOut2.java
- Executes an SPL function that has
an OUT parameter using CallableStatement methods
- CallOut3.java
- Executes a C function that has a Boolean OUT parameter
using the
IfmxCallableStatement.IfxRegisterOut
Parameter() method
- CallOut4.java
- Executes a C function that has a CLOB type OUT parameter
and uses the
IfmxCallableStatement.hasOutParameter() method
- CreateDB.java
- Creates a database called testDB
- DBCENTURYSelect.java
- Uses the getString() method to retrieve
a date string representation in which the four-digit year expansion
is based on the DBCENTURY property value
- DBCENTURYSelect2.java
- Retrieves a date string representation in which the four-digit
year expansion is based on the DBCENTURY property
value using string-to-binary conversion
Uses the getDate() method to build a java.sql.Date object
upon which the date string representation is based
- DBCENTURYSelect3.java
- Retrieves a date string representation in which the four-digit
year expansion is based on the DBCENTURY property
value using string-to-binary conversion
Uses the getTimestamp() method to build
a java.sql.Timestamp object upon which the
date string representation is based
- DBCENTURYSelect4.java
- Retrieves a date string representation in which the four-digit
year expansion is based on the DBCENTURY property
value using binary-to-string conversion
Uses the getDate() method to build a java.sql.Date object
upon which the date string representation is based
- DBCENTURYSelect5.java
- Retrieves a date string representation in which the four-digit
year expansion is based on the DBCENTURY property
value using binary-to-string conversion
Uses the getTimestamp() method to build
a java.sql.Timestamp object upon which the
date string representation is based
- DBConnection.java
- Creates connections to both a database and a database server
- DBDATESelect.java
- Shows how to retrieve a date object and a date string representation
from the database based on the DBDATE property
value from the URL string
- DBMetaData.java
- Shows how to retrieve information about a database with the DatabaseMetaData interface
- DropDB.java
- Drops a database called testDB
- ErrorHandling.java
- Shows how to retrieve RSAM error
messages
- GLDATESelect.java
- Shows how to retrieve a date object and a date string representation
from the database based on the GL_DATE property
value from the URL string
- Intervaldemo.java
- Shows how to insert and select Informix interval data
- LOCALESelect.java
- Shows how to retrieve a date object and a date string representation
from the database based on the CLIENT_LOCALE property
value from the URL string
- locmsg.java
- Shows how to use Informix extension methods that support localized
error messages
- MultiRowCall.java
- Shows how to return multiple rows in a stored procedure call
- OptimizedSelect.java
- Shows
how to use the FET_BUF_SIZE environment variable
to adjust the IBM Informix JDBC
Driver tuple buffer size
- optofc.java
- Shows
how to use the OPTOFC environment variable
- PropertyConnection.java
- Shows how to specify connection environment variables via
a property list
- RSMetaData.java
- Shows how to retrieve information about a result set with
the ResultSetMetaData interface
- ScrollCursor.java
- Shows how to retrieve a result set with a scroll cursor
- Serial.java
- Shows how to insert and select Informix SERIal and SERIal8
data
- SimpleCall.java
- Shows how to call a stored procedure
- SimpleConnection.java
- Shows how to connect to a database or database server
- SimpleSelect.java
- Shows how to send a simple SELECT query
to the database server
- TextConv.java
- Shows how to convert a file from the client code set to Unicode
and then from Unicode to the database code set
- TextType.java
- Shows how to insert into and select from a table that contains
a column of data type TEXT
- UpdateCursor1.java
- Shows how to create an updatable scroll cursor using a ROWID column
in the query
- UpdateCursor2.java
- Shows how to create an updatable scroll cursor using a SERIAL column
in the query
- UpdateCursor3.java
- Shows how to create an updatable scroll cursor using a primary
key column in the query
Examples in the clob-blob Directory
The following table lists the files in the clob-blob directory.
- Demo Program Name
- Description
- demo1.java
- Shows how to create two tables with BLOB and CLOB columns
and compare the data
- demo2.java
- Shows how to create one table with BYTE and TEXT columns
and a second table with BLOB and CLOB columns
and how to compare the data
- demo3.java
- Shows how to create one table with BLOB and CLOB columns
and a second table with BYTE and TEXT columns
and how to compare the data
- demo4.java
- Shows how to create two tables with BYTE and TEXT columns
and compare the data
- demo5.java
- Shows how to store data from a file into a BLOB table
column
- demo6.java
- Shows how to read a portion of the data in a smart large object
- demo_11.java
- Shows how to read data from a file into a buffer and write
the contents of the buffer into a smart large object
- demo_13.java
- Shows how to write data into a smart large object and then
insert the smart large object into a table
- demo_14.java
- Shows how to fetch smart large object data from a table
Examples in the udt-distinct Directory
The following table lists the files in the udt-distinct directory (there
are additional examples using opaque types in Examples in the udtudrmgr Directory.)
- Demo Program Name
- Description
- charattrUDT.java
- Shows how to implement an opaque fixed-length type using SQLData
- createDB.java
- Creates a database that the other udt-distinct demonstration
files use
- createTypes.java
- Shows how to create opaque and distinct types in the database
- distinct_d1.java
- Shows how to create a distinct type without using SQLData
- distinct_d2.java
- Shows how to create a second distinct type without using SQLData
- dropDB.java
- Drops the database that the other udt-distinct demonstration
files use
- largebinUDT.java
- Shows how to implement an opaque type (smart large object
embedded) using SQLData
- manualUDT.java
- Shows how to implement an opaque type that allows you to change
the position in the input stream
- myMoney.java
- Shows how to implement a distinct type using SQLData
- udt_d1.java
- Shows how to create a fixed-length opaque type
- udt_d2.java
- Shows how to create an opaque type with an embedded smart
large object
- udt_d3.java
- Shows how to create an opaque type that allows you to change
the position in the input stream
Examples in the complex-types Directory
The following table lists the files in the complex-types directory.
- Demo Program Name
- Description
- createDB.java
- Creates a database with named rows
- list1.java
- Inserts and selects a simple collection using both the java.sql.Array and java.util.Collection classes
- list2.java
- Inserts and selects a collection with a nested row element
Uses both the java.sql.Array and java.util.Collection classes
for the collection and both the SQLData and Struct interfaces
for the nested row
- r1_t.java
- Defines the SQLData class for named
row r1_t
- r2_t.java
- Defines the SQLData class for named
row r2_t
- GenericStruct.java
- Instantiates a java.sql.Struct object
for inserting into named or unnamed rows
- row1.java
- Inserts and selects a simple named row using both the SQLData and Struct interfaces
- row2.java
- Inserts and selects a named row with a nested collection using
both the SQLData and Struct interfaces
The SQLData interface uses the Informix IfmxComplexSQLOutput. writeObject() and IfmxComplexSQLOutput.readObject() extension
methods to write and read the nested collection.
- row3.java
- Inserts and selects an unnamed row with a nested collection
- fullname.java
- Contains the SQLData class for the named
row fullname_t
Used by the demo1.java and demo2.java files
- person.java
- Contains the SQLData class for the named
row person_t Used by the demo1.java and demo2.java files
- demo1.java
- Fetches a named row into an SQLData object
- demo2.java
- Inserts an SQLData object into a named
row column
- demo3.java
- Fetches an unnamed row column into a Struct object
- demo4.java
- Inserts a Struct object into a named
row column
- demo5.java
- Fetches an Informix SET column into
a java.util.HashSet object
- demo6.java
- Fetches an Informix SET column into
a java.util.TreeSet object
A customized type mapping is provided to override the default.
- demo7.java
- Inserts a java.util.HashSet object into
an Informix SET column
- demo8.java
- Fetches an Informix SET column into
a java.sql.Array object
- dropDB.java
- Drops the database
Examples in the proxy Directory
The following table lists the files in the proxy directory.
A README file in the directory contains setup information.
- Demo Program Name
- Description
- ProxySelect.java
- (application) Creates a sample database and connects to it
using four scenarios:
- Connection with a proxy server and no LDAP server
- Connection with an LDAP server and
no proxy server
- Connection using an sqlhosts file Direct connection
(no proxy servlet, sqlhosts file, or LDAP server)
- proxy.sh
- (shell script) Launches ProxySelect.java.
To run the script (and the demo), type:
proxy.sh -d ProxySelect -s 2
- proxy.java
- (applet) Performs the same operations as ProxySelect.java from
an applet. To run the applet, type:
appletviewer proxy.html
- proxy.html
- HTML file for proxy.java
- ifmx.conf
- Sample LDAP configuration file
- ifmx.ldif
- Sample LDAP ldif file
Examples in the connection-pool Directory
The following table lists the files in the connection-pool directory.
A README file in the directory contains setup information.
- Demo Program Name
- Description
- AppSimulator.java
- Simulates multiple client threads making DataSource connections
- SetupDB.java
- Creates and populates a sample database. See the comments
at the beginning of the code for a sample run command
- DS_Pool.prop
- Lists properties for a connection-pooling application
- myCPDS.prop
- Lists properties for a connection-pooling application, with
the optional tuning parameters included
- DS_no_Pool.prop
- Lists properties for an application without connection pooling
- Register.java
- Registers a DataSource object with a
JNDI Name registry
A sample run command is:
java Register DS_no_Pool /tmp
- runDemo
- (Shell script) Creates and populates a sample database; registers
the data sources DS_no_Pool and DS_Pool; and runs an application
to simulate multiple client threads that connect to the sample database
Examples in the xml Directory
The following table lists the files in the xml directory.
- Demod Program Name
- Description
- CreateDB.java
- Creates a sample database
- makefile
- Compiles the examples
- myHandler.java
- Sample class of callback routines for the SAX parser
- sample1.xml
- Simple XML slide
- sample2.xml
- Sample set of XML slides
- sample2.dtd
- Document-type definition for sample1.xml
- xmldemo1.java
- Uses XMLtoString(), getInputSource(),
and myHandler.java to convert the XML in sample1.xml to
an InputSource object and then parses it using the SAX parser
Examples In the hdr Directory
The following table lists the files in the hdr directory.
A README file in the directory contains setup information.
- Demo Program Name
- Description
- SetupDB.java
- Creates a sample database and table
- Register.java
- Registers the DS_no_Pool and DS_Pool DataSource objects
with a JNDI Name registry. A sample run command is:
java Register DS_no_Pool /tmp
- AppSimulator.java
- Simulates High-Availability Data Replication redirection for
pooled and nonpooled connections made with the DataSource.getConnection() method
- HdrSimpleConnect.java
- Shows how to implement HDR redirection with the DriverManager.getConnection() method
Home |
[ Top of Page | Previous Page | Next Page | Contents |
Index ]