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);
}
Aggregations