Writing DDL statements to modify IMS resources with the IMS Universal JDBC driver

You can write a java application to create or modify an active DBD or PSB in an IMS system.

Procedure

  1. Create a connection to an IMS system by using the Universal Drivers.
  2. Create a statement and execute the DDL query.
  3. Execute a query called Commit DDL.
    For example:
    ds = FVTConnectionFactory.getIMSDataSource(alias, driverType, 
    host, port, userName, 
    
    password, url);
    con = ds.getConnection();
    
    
    
    Statement st = con.createStatement();
    st.executeUpdate("CREATE DATABASE MYDB ACCESS SHSAM CCSID 'Cp1047'
    
    VERSION '2.0'"); 
    st.executeUpdate("CREATE TABLE MYTABLE (COLUMN1 DECIMAL(5,2)
    
    INTERNALNAME COLUMN1 TYPE C BYTES 10 START 1) AMBIGUOUS INSERT LAST IN MYDB");
    st.executeUpdate("CREATE TABLESPACE tb1 IN MYDB BLOCK PRIMARY
    
    32768"); 
    st.executeUpdate("COMMIT DDL");