本文整理匯總了Java中javax.sql.RowSet.updateInt方法的典型用法代碼示例。如果您正苦於以下問題:Java RowSet.updateInt方法的具體用法?Java RowSet.updateInt怎麽用?Java RowSet.updateInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.sql.RowSet
的用法示例。
在下文中一共展示了RowSet.updateInt方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: commonCachedRowSetTest0007
import javax.sql.RowSet; //導入方法依賴的package包/類
@Test(dataProvider = "rowsetUsingCoffeeHouses")
public void commonCachedRowSetTest0007(RowSet rs) throws Exception {
TestRowSetListener rsl = new TestRowSetListener();
TestRowSetListener rsl2 = new TestRowSetListener();
rs.addRowSetListener(rsl);
rs.addRowSetListener(rsl2);
rs.first();
rs.updateInt(1, 1961);
rs.updateString(2, "Pittsburgh");
rs.updateInt(3, 1987);
rs.updateInt(4, 2341);
rs.updateInt(5, 6689);
rs.updateRow();
assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED
| TestRowSetListener.ROW_CHANGED));
assertTrue(rsl2.isNotified(TestRowSetListener.CURSOR_MOVED
| TestRowSetListener.ROW_CHANGED));
rs.close();
}
示例2: createDataTypesRows
import javax.sql.RowSet; //導入方法依賴的package包/類
protected void createDataTypesRows(RowSet crs) throws SQLException {
Integer aInteger = 100;
String aChar = "Oswald Cobblepot";
Long aLong = Long.MAX_VALUE;
Short aShort = Short.MAX_VALUE;
Double aDouble = Double.MAX_VALUE;
BigDecimal aBigDecimal = BigDecimal.ONE;
Boolean aBoolean = false;
Float aFloat = Float.MAX_VALUE;
Byte aByte = Byte.MAX_VALUE;
Date aDate = Date.valueOf(LocalDate.now());
Time aTime = Time.valueOf(LocalTime.now());
Timestamp aTimeStamp = Timestamp.valueOf(LocalDateTime.now());
Array aArray = new StubArray("INTEGER", new Object[1]);
Ref aRef = new SerialRef(new StubRef("INTEGER", query));
byte[] bytes = new byte[10];
crs.moveToInsertRow();
crs.updateInt(1, aInteger);
crs.updateString(2, aChar);
crs.updateString(3, aChar);
crs.updateLong(4, aLong);
crs.updateBoolean(5, aBoolean);
crs.updateShort(6, aShort);
crs.updateDouble(7, aDouble);
crs.updateBigDecimal(8, aBigDecimal);
crs.updateFloat(9, aFloat);
crs.updateByte(10, aByte);
crs.updateDate(11, aDate);
crs.updateTime(12, aTime);
crs.updateTimestamp(13, aTimeStamp);
crs.updateBytes(14, bytes);
crs.updateArray(15, aArray);
crs.updateRef(16, aRef);
crs.updateDouble(17, aDouble);
crs.insertRow();
crs.moveToCurrentRow();
}
示例3: commonCachedRowSetTest0006
import javax.sql.RowSet; //導入方法依賴的package包/類
@Test(dataProvider = "rowsetUsingCoffeeHouses")
public void commonCachedRowSetTest0006(RowSet rs) throws Exception {
TestRowSetListener rsl = new TestRowSetListener();
rs.addRowSetListener(rsl);
rs.moveToInsertRow();
rs.updateInt(1, 10024);
rs.updateString(2, "Sacramento");
rs.updateInt(3, 1987);
rs.updateInt(4, 2341);
rs.updateInt(5, 4328);
rs.insertRow();
assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
rs.close();
}
示例4: createCoffeesRows
import javax.sql.RowSet; //導入方法依賴的package包/類
protected void createCoffeesRows(RowSet rs) throws SQLException {
// insert into COFFEES values(1, 'Colombian', 101, 7.99, 0, 0)
rs.moveToInsertRow();
rs.updateInt(1, 1);
rs.updateString(2, "Colombian");
rs.updateInt(3, 101);
rs.updateBigDecimal(4, BigDecimal.valueOf(7.99));
rs.updateInt(5, 0);
rs.updateInt(6, 0);
rs.insertRow();
// insert into COFFEES values(2, 'French_Roast', 49, 8.99, 0, 0)
rs.moveToInsertRow();
rs.updateInt(1, 2);
rs.updateString(2, "French_Roast");
rs.updateInt(3, 49);
rs.updateBigDecimal(4, BigDecimal.valueOf(8.99));
rs.updateInt(5, 0);
rs.updateInt(6, 0);
rs.insertRow();
// insert into COFFEES values(3, 'Espresso', 150, 9.99, 0, 0)
rs.moveToInsertRow();
rs.updateInt(1, 3);
rs.updateString(2, "Espresso");
rs.updateInt(3, 150);
rs.updateBigDecimal(4, BigDecimal.valueOf(9.99));
rs.updateInt(5, 0);
rs.updateInt(6, 0);
rs.insertRow();
// insert into COFFEES values(4, 'Colombian_Decaf', 101, 8.99, 0, 0)
rs.moveToInsertRow();
rs.updateInt(1, 4);
rs.updateString(2, "Colombian_Decaf");
rs.updateInt(3, 101);
rs.updateBigDecimal(4, BigDecimal.valueOf(8.99));
rs.updateInt(5, 0);
rs.updateInt(6, 0);
rs.insertRow();
// insert into COFFEES values(5, 'French_Roast_Decaf', 049, 9.99, 0, 0)
rs.moveToInsertRow();
rs.updateInt(1, 5);
rs.updateString(2, "French_Roast_Decaf");
rs.updateInt(3, 49);
rs.updateBigDecimal(4, BigDecimal.valueOf(9.99));
rs.updateInt(5, 0);
rs.updateInt(6, 0);
rs.insertRow();
}
示例5: createSuppiersRows
import javax.sql.RowSet; //導入方法依賴的package包/類
protected void createSuppiersRows(RowSet rs) throws SQLException {
// insert into SUPPLIERS values(49, 'Superior Coffee', '1 Party Place',
// 'Mendocino', 'CA', '95460')
rs.moveToInsertRow();
rs.updateInt(1, 49);
rs.updateString(2, "Superior Coffee");
rs.updateString(3, "1 Party Place");
rs.updateString(4, "Mendocino");
rs.updateString(5, "CA");
rs.updateString(6, "95460");
rs.insertRow();
// insert into SUPPLIERS values(101, 'Acme, Inc.', '99 Market Street',
// 'Groundsville', 'CA', '95199')
rs.moveToInsertRow();
rs.updateInt(1, 101);
rs.updateString(2, "Acme, Inc.");
rs.updateString(3, "99 Market Street");
rs.updateString(4, "Groundsville");
rs.updateString(5, "CA");
rs.updateString(6, "95199");
rs.insertRow();
// insert into SUPPLIERS values(150, 'The High Ground',
// '100 Coffee Lane', 'Meadows', 'CA', '93966')
rs.moveToInsertRow();
rs.updateInt(1, 150);
rs.updateString(2, "The High Ground");
rs.updateString(3, "100 Coffee Lane");
rs.updateString(4, "Meadows");
rs.updateString(5, "CA");
rs.updateString(6, "93966");
rs.insertRow();
// insert into SUPPLIERS values(456," 'Restaurant Supplies, Inc.',
// '200 Magnolia Street', 'Meadows', 'CA', '93966')
rs.moveToInsertRow();
rs.updateInt(1, 456);
rs.updateString(2, "Restaurant Supplies, Inc.");
rs.updateString(3, "200 Magnolia Stree");
rs.updateString(4, "Meadows");
rs.updateString(5, "CA");
rs.updateString(6, "93966");
rs.insertRow();
// insert into SUPPLIERS values(927, 'Professional Kitchen',
// '300 Daisy Avenue', 'Groundsville'," 'CA', '95199')
rs.moveToInsertRow();
rs.updateInt(1, 927);
rs.updateString(2, "Professional Kitchen");
rs.updateString(3, "300 Daisy Avenue");
rs.updateString(4, "Groundsville");
rs.updateString(5, "CA");
rs.updateString(6, "95199");
rs.insertRow();
}