Java Code Examples for javax.sql.rowset.CachedRowSet#setType()

The following examples show how to use javax.sql.rowset.CachedRowSet#setType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommonRowSetTests.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void initCoffeesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEES (
     *   COF_ID INTEGER NOT NULL,
     *   COF_NAME VARCHAR(32) NOT NULL,
     *   SUP_ID INTEGER NOT NULL,
     *   PRICE NUMBERIC(10,2 NOT NULL,
     *   SALES INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (COF_ID),
     *   FOREIGN KEY (SUP_ID) REFERENCES SUPPLIERS (SUP_ID) )
     */
    rsmd.setColumnCount(COFFEES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.NUMERIC);
    rsmd.setPrecision(4, 10);
    rsmd.setScale(4, 2);
    rsmd.setColumnType(5, Types.INTEGER);
    rsmd.setColumnType(6, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEES_TABLE);

}
 
Example 2
Source File: CommonRowSetTests.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected void initCoffeesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEES (
     *   COF_ID INTEGER NOT NULL,
     *   COF_NAME VARCHAR(32) NOT NULL,
     *   SUP_ID INTEGER NOT NULL,
     *   PRICE NUMBERIC(10,2 NOT NULL,
     *   SALES INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (COF_ID),
     *   FOREIGN KEY (SUP_ID) REFERENCES SUPPLIERS (SUP_ID) )
     */
    rsmd.setColumnCount(COFFEES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.NUMERIC);
    rsmd.setPrecision(4, 10);
    rsmd.setScale(4, 2);
    rsmd.setColumnType(5, Types.INTEGER);
    rsmd.setColumnType(6, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEES_TABLE);

}
 
Example 3
Source File: CommonRowSetTests.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void initCoffeeHousesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEE_HOUSES(
     *   STORE_ID Integer NOT NULL,
     *   CITY VARCHAR(32),
     *   COFFEE INTEGER NOT NULL,
     *   MERCH INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (STORE_ID))
     */
    rsmd.setColumnCount(COFFEE_HOUSES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEE_HOUSES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEE_HOUSES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.INTEGER);
    rsmd.setColumnType(5, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEE_HOUSES_TABLE);

}
 
Example 4
Source File: CommonCachedRowSetTests.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected void initDataTypesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    rsmd.setColumnCount(DATATYPES_COLUMN_NAMES.length);

    for (int i = 1; i <= DATATYPES_COLUMN_NAMES.length; i++) {
        rsmd.setColumnName(i, DATATYPES_COLUMN_NAMES[i - 1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.CHAR);
    rsmd.setColumnType(3, Types.VARCHAR);
    rsmd.setColumnType(4, Types.BIGINT);
    rsmd.setColumnType(5, Types.BOOLEAN);
    rsmd.setColumnType(6, Types.SMALLINT);
    rsmd.setColumnType(7, Types.DOUBLE);
    rsmd.setColumnType(8, Types.DECIMAL);
    rsmd.setColumnType(9, Types.REAL);
    rsmd.setColumnType(10, Types.TINYINT);
    rsmd.setColumnType(11, Types.DATE);
    rsmd.setColumnType(12, Types.TIME);
    rsmd.setColumnType(13, Types.TIMESTAMP);
    rsmd.setColumnType(14, Types.VARBINARY);
    rsmd.setColumnType(15, Types.ARRAY);
    rsmd.setColumnType(16, Types.REF);
    rsmd.setColumnType(17, Types.FLOAT);
    crs.setMetaData(rsmd);

}
 
Example 5
Source File: CommonRowSetTests.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected void initCoffeesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEES (
     *   COF_ID INTEGER NOT NULL,
     *   COF_NAME VARCHAR(32) NOT NULL,
     *   SUP_ID INTEGER NOT NULL,
     *   PRICE NUMBERIC(10,2 NOT NULL,
     *   SALES INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (COF_ID),
     *   FOREIGN KEY (SUP_ID) REFERENCES SUPPLIERS (SUP_ID) )
     */
    rsmd.setColumnCount(COFFEES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.NUMERIC);
    rsmd.setPrecision(4, 10);
    rsmd.setScale(4, 2);
    rsmd.setColumnType(5, Types.INTEGER);
    rsmd.setColumnType(6, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEES_TABLE);

}
 
Example 6
Source File: CommonRowSetTests.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void initCoffeeHousesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEE_HOUSES(
     *   STORE_ID Integer NOT NULL,
     *   CITY VARCHAR(32),
     *   COFFEE INTEGER NOT NULL,
     *   MERCH INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (STORE_ID))
     */
    rsmd.setColumnCount(COFFEE_HOUSES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEE_HOUSES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEE_HOUSES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.INTEGER);
    rsmd.setColumnType(5, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEE_HOUSES_TABLE);

}
 
Example 7
Source File: CommonCachedRowSetTests.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected void initDataTypesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    rsmd.setColumnCount(DATATYPES_COLUMN_NAMES.length);

    for (int i = 1; i <= DATATYPES_COLUMN_NAMES.length; i++) {
        rsmd.setColumnName(i, DATATYPES_COLUMN_NAMES[i - 1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.CHAR);
    rsmd.setColumnType(3, Types.VARCHAR);
    rsmd.setColumnType(4, Types.BIGINT);
    rsmd.setColumnType(5, Types.BOOLEAN);
    rsmd.setColumnType(6, Types.SMALLINT);
    rsmd.setColumnType(7, Types.DOUBLE);
    rsmd.setColumnType(8, Types.DECIMAL);
    rsmd.setColumnType(9, Types.REAL);
    rsmd.setColumnType(10, Types.TINYINT);
    rsmd.setColumnType(11, Types.DATE);
    rsmd.setColumnType(12, Types.TIME);
    rsmd.setColumnType(13, Types.TIMESTAMP);
    rsmd.setColumnType(14, Types.VARBINARY);
    rsmd.setColumnType(15, Types.ARRAY);
    rsmd.setColumnType(16, Types.REF);
    rsmd.setColumnType(17, Types.FLOAT);
    crs.setMetaData(rsmd);

}
 
Example 8
Source File: CommonRowSetTests.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected void initCoffeesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEES (
     *   COF_ID INTEGER NOT NULL,
     *   COF_NAME VARCHAR(32) NOT NULL,
     *   SUP_ID INTEGER NOT NULL,
     *   PRICE NUMBERIC(10,2 NOT NULL,
     *   SALES INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (COF_ID),
     *   FOREIGN KEY (SUP_ID) REFERENCES SUPPLIERS (SUP_ID) )
     */
    rsmd.setColumnCount(COFFEES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.NUMERIC);
    rsmd.setPrecision(4, 10);
    rsmd.setScale(4, 2);
    rsmd.setColumnType(5, Types.INTEGER);
    rsmd.setColumnType(6, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEES_TABLE);

}
 
Example 9
Source File: CommonRowSetTests.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void initCoffeeHousesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEE_HOUSES(
     *   STORE_ID Integer NOT NULL,
     *   CITY VARCHAR(32),
     *   COFFEE INTEGER NOT NULL,
     *   MERCH INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (STORE_ID))
     */
    rsmd.setColumnCount(COFFEE_HOUSES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEE_HOUSES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEE_HOUSES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.INTEGER);
    rsmd.setColumnType(5, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEE_HOUSES_TABLE);

}
 
Example 10
Source File: CommonRowSetTests.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void initCoffeeHousesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEE_HOUSES(
     *   STORE_ID Integer NOT NULL,
     *   CITY VARCHAR(32),
     *   COFFEE INTEGER NOT NULL,
     *   MERCH INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (STORE_ID))
     */
    rsmd.setColumnCount(COFFEE_HOUSES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEE_HOUSES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEE_HOUSES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.INTEGER);
    rsmd.setColumnType(5, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEE_HOUSES_TABLE);

}
 
Example 11
Source File: CommonRowSetTests.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void initCoffeeHousesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEE_HOUSES(
     *   STORE_ID Integer NOT NULL,
     *   CITY VARCHAR(32),
     *   COFFEE INTEGER NOT NULL,
     *   MERCH INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (STORE_ID))
     */
    rsmd.setColumnCount(COFFEE_HOUSES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEE_HOUSES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEE_HOUSES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.INTEGER);
    rsmd.setColumnType(5, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEE_HOUSES_TABLE);

}
 
Example 12
Source File: CommonCachedRowSetTests.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected void initDataTypesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    rsmd.setColumnCount(DATATYPES_COLUMN_NAMES.length);

    for (int i = 1; i <= DATATYPES_COLUMN_NAMES.length; i++) {
        rsmd.setColumnName(i, DATATYPES_COLUMN_NAMES[i - 1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.CHAR);
    rsmd.setColumnType(3, Types.VARCHAR);
    rsmd.setColumnType(4, Types.BIGINT);
    rsmd.setColumnType(5, Types.BOOLEAN);
    rsmd.setColumnType(6, Types.SMALLINT);
    rsmd.setColumnType(7, Types.DOUBLE);
    rsmd.setColumnType(8, Types.DECIMAL);
    rsmd.setColumnType(9, Types.REAL);
    rsmd.setColumnType(10, Types.TINYINT);
    rsmd.setColumnType(11, Types.DATE);
    rsmd.setColumnType(12, Types.TIME);
    rsmd.setColumnType(13, Types.TIMESTAMP);
    rsmd.setColumnType(14, Types.VARBINARY);
    rsmd.setColumnType(15, Types.ARRAY);
    rsmd.setColumnType(16, Types.REF);
    rsmd.setColumnType(17, Types.FLOAT);
    crs.setMetaData(rsmd);

}
 
Example 13
Source File: CommonCachedRowSetTests.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected void initDataTypesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    rsmd.setColumnCount(DATATYPES_COLUMN_NAMES.length);

    for (int i = 1; i <= DATATYPES_COLUMN_NAMES.length; i++) {
        rsmd.setColumnName(i, DATATYPES_COLUMN_NAMES[i - 1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.CHAR);
    rsmd.setColumnType(3, Types.VARCHAR);
    rsmd.setColumnType(4, Types.BIGINT);
    rsmd.setColumnType(5, Types.BOOLEAN);
    rsmd.setColumnType(6, Types.SMALLINT);
    rsmd.setColumnType(7, Types.DOUBLE);
    rsmd.setColumnType(8, Types.DECIMAL);
    rsmd.setColumnType(9, Types.REAL);
    rsmd.setColumnType(10, Types.TINYINT);
    rsmd.setColumnType(11, Types.DATE);
    rsmd.setColumnType(12, Types.TIME);
    rsmd.setColumnType(13, Types.TIMESTAMP);
    rsmd.setColumnType(14, Types.VARBINARY);
    rsmd.setColumnType(15, Types.ARRAY);
    rsmd.setColumnType(16, Types.REF);
    rsmd.setColumnType(17, Types.FLOAT);
    crs.setMetaData(rsmd);

}
 
Example 14
Source File: CommonRowSetTests.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected void initCoffeesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEES (
     *   COF_ID INTEGER NOT NULL,
     *   COF_NAME VARCHAR(32) NOT NULL,
     *   SUP_ID INTEGER NOT NULL,
     *   PRICE NUMBERIC(10,2 NOT NULL,
     *   SALES INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (COF_ID),
     *   FOREIGN KEY (SUP_ID) REFERENCES SUPPLIERS (SUP_ID) )
     */
    rsmd.setColumnCount(COFFEES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.NUMERIC);
    rsmd.setPrecision(4, 10);
    rsmd.setScale(4, 2);
    rsmd.setColumnType(5, Types.INTEGER);
    rsmd.setColumnType(6, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEES_TABLE);

}
 
Example 15
Source File: CommonRowSetTests.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void initCoffeeHousesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEE_HOUSES(
     *   STORE_ID Integer NOT NULL,
     *   CITY VARCHAR(32),
     *   COFFEE INTEGER NOT NULL,
     *   MERCH INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (STORE_ID))
     */
    rsmd.setColumnCount(COFFEE_HOUSES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEE_HOUSES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEE_HOUSES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.INTEGER);
    rsmd.setColumnType(5, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEE_HOUSES_TABLE);

}
 
Example 16
Source File: CommonRowSetTests.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected void initCoffeesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEES (
     *   COF_ID INTEGER NOT NULL,
     *   COF_NAME VARCHAR(32) NOT NULL,
     *   SUP_ID INTEGER NOT NULL,
     *   PRICE NUMBERIC(10,2 NOT NULL,
     *   SALES INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (COF_ID),
     *   FOREIGN KEY (SUP_ID) REFERENCES SUPPLIERS (SUP_ID) )
     */
    rsmd.setColumnCount(COFFEES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.NUMERIC);
    rsmd.setPrecision(4, 10);
    rsmd.setScale(4, 2);
    rsmd.setColumnType(5, Types.INTEGER);
    rsmd.setColumnType(6, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEES_TABLE);

}
 
Example 17
Source File: CommonRowSetTests.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected void initCoffeesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEES (
     *   COF_ID INTEGER NOT NULL,
     *   COF_NAME VARCHAR(32) NOT NULL,
     *   SUP_ID INTEGER NOT NULL,
     *   PRICE NUMBERIC(10,2 NOT NULL,
     *   SALES INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (COF_ID),
     *   FOREIGN KEY (SUP_ID) REFERENCES SUPPLIERS (SUP_ID) )
     */
    rsmd.setColumnCount(COFFEES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.NUMERIC);
    rsmd.setPrecision(4, 10);
    rsmd.setScale(4, 2);
    rsmd.setColumnType(5, Types.INTEGER);
    rsmd.setColumnType(6, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEES_TABLE);

}
 
Example 18
Source File: CommonRowSetTests.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private void initCoffeeHousesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEE_HOUSES(
     *   STORE_ID Integer NOT NULL,
     *   CITY VARCHAR(32),
     *   COFFEE INTEGER NOT NULL,
     *   MERCH INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (STORE_ID))
     */
    rsmd.setColumnCount(COFFEE_HOUSES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEE_HOUSES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEE_HOUSES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.INTEGER);
    rsmd.setColumnType(5, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEE_HOUSES_TABLE);

}
 
Example 19
Source File: CommonRowSetTests.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected void initCoffeesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEES (
     *   COF_ID INTEGER NOT NULL,
     *   COF_NAME VARCHAR(32) NOT NULL,
     *   SUP_ID INTEGER NOT NULL,
     *   PRICE NUMBERIC(10,2 NOT NULL,
     *   SALES INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (COF_ID),
     *   FOREIGN KEY (SUP_ID) REFERENCES SUPPLIERS (SUP_ID) )
     */
    rsmd.setColumnCount(COFFEES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.NUMERIC);
    rsmd.setPrecision(4, 10);
    rsmd.setScale(4, 2);
    rsmd.setColumnType(5, Types.INTEGER);
    rsmd.setColumnType(6, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEES_TABLE);

}
 
Example 20
Source File: CommonRowSetTests.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected void initCoffeesMetaData(CachedRowSet crs) throws SQLException {
    RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
    crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);

    /*
     *  CREATE TABLE COFFEES (
     *   COF_ID INTEGER NOT NULL,
     *   COF_NAME VARCHAR(32) NOT NULL,
     *   SUP_ID INTEGER NOT NULL,
     *   PRICE NUMBERIC(10,2 NOT NULL,
     *   SALES INTEGER NOT NULL,
     *   TOTAL INTEGER NOT NULL,
     *   PRIMARY KEY (COF_ID),
     *   FOREIGN KEY (SUP_ID) REFERENCES SUPPLIERS (SUP_ID) )
     */
    rsmd.setColumnCount(COFFEES_COLUMN_NAMES.length);
    for(int i = 1; i <= COFFEES_COLUMN_NAMES.length; i++){
        rsmd.setColumnName(i, COFFEES_COLUMN_NAMES[i-1]);
        rsmd.setColumnLabel(i, rsmd.getColumnName(i));
    }

    rsmd.setColumnType(1, Types.INTEGER);
    rsmd.setColumnType(2, Types.VARCHAR);
    rsmd.setColumnType(3, Types.INTEGER);
    rsmd.setColumnType(4, Types.NUMERIC);
    rsmd.setPrecision(4, 10);
    rsmd.setScale(4, 2);
    rsmd.setColumnType(5, Types.INTEGER);
    rsmd.setColumnType(6, Types.INTEGER);
    crs.setMetaData(rsmd);
    crs.setTableName(COFFEES_TABLE);

}