Java Code examples
The following is a list of Java™ code examples for the IBM® i.
Internationalization
- Example: Internationalization of dates using the java.util.DateFormat class
- Example: Internationalization of numeric display using the java.util.NumberFormat class
- Example: Internationalization of locale-specific data using the java.util.ResourceBundle class
JDBC
- Example: Access property
- Example: BLOB
- Example: CallableStatement interface for IBM Developer Kit for Java
- Example: Removing values from a table through another statement's cursor
- Example: CLOB
- Example: Creating a UDBDataSource and binding it with JNDI
- Example: Creating a UDBDataSource and obtaining a user ID and password
- Example: Creating a UDBDataSourceBind and setting DataSource properties
- Example: Returning a list of tables using the DatabaseMetaData interface
- Example: Creating a UDBDataSource and binding it with JNDI
- Example: Datalink
- Example: Distinct types
- Example: Embedding SQL Statements in your Java application
- Example: Ending a transaction
- Example: Invalid user ID and password
- Example: JDBC
- Example: Multiple connections that work on a transaction
- Example: Obtaining an initial context before binding UDBDataSource
- Example: ParameterMetaData
- Example: Changing values with a statement through another statement's cursor
- Example: ResultSet interface
- Example: ResultSet sensitivity
- Example: Sensitive and insensitive ResultSets
- Example: Setting up connection pooling with UDBDataSource and UDBConnectionPoolDataSource
- Example: SQLException
- Example: Suspending and resuming a transaction
- Example: Suspended ResultSets
- Example: Testing the performance of connection pooling
- Example: Testing the performance of two DataSources
- Example: Updating BLOBs
- Example: Updating CLOBs
- Example: Using a connection with multiple transactions
- Example: Using BLOBs
- Example: Using CLOBs
- Creating and populating a DB2CachedRowSet
- Creating and populating a DB2CachedRowSet
- Example: Using JTA to handle a transaction
- Example: Using metadata ResultSets that have more than one column
- Example: Using native JDBC and IBM Toolbox for Java JDBC concurrently
- Example: Using PreparedStatement to obtain a ResultSet
- Creating and populating a DB2CachedRowSet
- Creating and populating a DB2CachedRowSet
- Creating and populating a DB2CachedRowSet
- Creating and populating a DB2CachedRowSet
- Example: Using the Statement object's executeUpdate method
Java Authentication and Authorization Service
Java Generic Security Service
- Sample: IBM JGSS non-JAAS client program
- Sample: IBM JGSS non-JAAS server program
- Sample: IBM JGSS JAAS-enabled client program
- Sample: IBM JGSS JAAS-enabled server program
Java Secure Sockets Extension
Java with other programming languages
- Example: Calling a CL program with java.lang.Runtime.exec()
- Example: Calling a CL command with java.lang.Runtime.exec()
- Example: Calling another Java program with java.lang.Runtime.exec()
- Example: Calling Java from ILE C
- Example: Calling Java from RPG
- Example: Using input and output streams for interprocess communication
- Example: Java Invocation API
- Example: IBM PASE for i native method for Java
- Sockets
- Example: ILE native method for Java
SQLJ
Secure sockets layer
- Examples: Changing your Java code to use client socket factories
- Examples: Changing your Java code to use server socket factories
- Examples: Changing your Java client to use secure sockets layer
- Examples: Changing your Java server to use secure sockets layer
IBM grants you a nonexclusive copyright license to use all programming code examples from which you can generate similar function tailored to your own specific needs.
SUBJECT TO ANY STATUTORY WARRANTIES WHICH CANNOT BE EXCLUDED, IBM, ITS PROGRAM DEVELOPERS AND SUPPLIERS MAKE NO WARRANTIES OR CONDITIONS EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT, REGARDING THE PROGRAM OR TECHNICAL SUPPORT, IF ANY.
UNDER NO CIRCUMSTANCES IS IBM, ITS PROGRAM DEVELOPERS OR SUPPLIERS LIABLE FOR ANY OF THE FOLLOWING, EVEN IF INFORMED OF THEIR POSSIBILITY:
- LOSS OF, OR DAMAGE TO, DATA;
- DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES, OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES; OR
- LOST PROFITS, BUSINESS, REVENUE, GOODWILL, OR ANTICIPATED SAVINGS.
SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF DIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, SO SOME OR ALL OF THE ABOVE LIMITATIONS OR EXCLUSIONS MAY NOT APPLY TO YOU.