Java Code Examples for javax.sql.rowset.RowSetMetaDataImpl#setScale()
The following examples show how to use
javax.sql.rowset.RowSetMetaDataImpl#setScale() .
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 dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
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 TencentKona-8 with GNU General Public License v2.0 | 5 votes |
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 jdk8u60 with GNU General Public License v2.0 | 5 votes |
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 4
Source File: CommonRowSetTests.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
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 5
Source File: CommonRowSetTests.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
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 |
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 7
Source File: CommonRowSetTests.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
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 8
Source File: CommonRowSetTests.java From hottub with GNU General Public License v2.0 | 5 votes |
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 jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
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); }