Search in sources :

Example 6 with RowSetMetaDataImpl

use of javax.sql.rowset.RowSetMetaDataImpl in project jdk8u_jdk by JetBrains.

the class JoinRowSetTests method initSuppliersMetaData.

/*
     * Initializes the SUPPLIERS metadata
     */
private void initSuppliersMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    /*
         *  CREATE TABLE SUPPLIERS (
         *   SUP_ID INTEGER NOT NULL,
         *   SUP_NAME VARCHAR(32) NOT NULL,
         *   STREET VARCHAR(32) NOT NULL,
         *   CITY VARCHAR(32) NOT NULL,
         *   STATE CHAR(2) NOT NULL,
         *   ZIP CHAR(5) NOT NULL,
         *   PRIMARY KEY (SUP_ID))
         */
    rsmd.setColumnCount(6);
    rsmd.setColumnName(1, "SUP_ID");
    rsmd.setColumnName(2, "SUP_NAME");
    rsmd.setColumnName(3, "STREET");
    rsmd.setColumnName(4, "CITY");
    rsmd.setColumnName(5, "STATE");
    rsmd.setColumnName(6, "ZIP");
    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.VARCHAR);
    rsmd.setColumnType(4, Types.VARCHAR);
    rsmd.setColumnType(5, Types.CHAR);
    rsmd.setColumnType(6, Types.CHAR);
    crs.setMetaData(rsmd);
    crs.setTableName(SUPPLIERS_TABLE);
}
Also used : RowSetMetaDataImpl(javax.sql.rowset.RowSetMetaDataImpl)

Aggregations

RowSetMetaDataImpl (javax.sql.rowset.RowSetMetaDataImpl)6 ResultSetMetaData (java.sql.ResultSetMetaData)1 RowSetMetaData (javax.sql.RowSetMetaData)1 BeforeMethod (org.testng.annotations.BeforeMethod)1 Test (org.testng.annotations.Test)1 BaseTest (util.BaseTest)1