📄 updatableresultset.out
字号:
{e1,null}
{e2,e1}
{e3,e2}
{e4,e3}
column 1 on this row is e1
update row should fail because cascade constraint is update restrict
SQL State : 23503
Got expected exception UPDATE on table 'SELFREFERENCINGT2' caused a violation of foreign key constraint 'MANAGES2' for key (e1). The statement has been rolled back.
Positive Test15 - With autocommit off, attempt to drop a table when there is an open updatable resultset on it
Opened an updatable resultset. Now trying to drop that table through another Statement
SQL State : X0X95
Got expected exception Operation 'DROP TABLE' cannot be performed on object 'T1' because there is an open ResultSet dependent on that object.
Since autocommit is off, the drop table exception will NOT result in a runtime rollback and hence updatable resultset object is still open
Positive Test16a - Do deleteRow within a transaction and then rollback the transaction
Verify that before delete trigger got fired, row count is 0 in deleteTriggerInsertIntoThisTable
1
-
{0}
Verify that before deleteRow, row count is 4 in table0WithTriggers
1
-
{4}
column 1 on this row is 1
now try to delete row and make sure that trigger got fired
Verify that delete trigger got fired by verifying the row count to be 1 in deleteTriggerInsertIntoThisTable
1
-
{1}
Verify that deleteRow in transaction, row count is 3 in table0WithTriggers
1
-
{3}
Verify that after rollback, row count is back to 0 in deleteTriggerInsertIntoThisTable
1
-
{0}
Verify that after rollback, row count is back to 4 in table0WithTriggers
1
-
{4}
Positive Test16b - Do updateRow within a transaction and then rollback the transaction
Verify that before update trigger got fired, row count is 0 in updateTriggerInsertIntoThisTable
1
-
{0}
Look at the data in table0WithTriggers before trigger gets fired
C1,C2
-- --
{1,1}
{2,2}
{3,3}
{4,4}
column 1 on this row is 1
now try to update row and make sure that trigger got fired
Verify that update trigger got fired by verifying the row count to be 1 in updateTriggerInsertIntoThisTable
1
-
{1}
Verify that new data in table0WithTriggers
C1,C2
-- --
{123,1}
{2,2}
{3,3}
{4,4}
Verify that after rollback, row count is back to 0 in updateTriggerInsertIntoThisTable
1
-
{0}
Verify that after rollback, table0WithTriggers is back to its original contents
C1,C2
-- --
{1,1}
{2,2}
{3,3}
{4,4}
Positive Test17 - After deleteRow, resultset is positioned before the next row
getXXX right after deleteRow will fail because resultset is not positioned on a row, instead it is right before the next row
SQL State : 24000
Got expected exception Invalid cursor state - no current row.
Positive Test18 - Test cancelRowUpdates method as the first updatable ResultSet api on a read-only resultset
SQL State : XJ083
Got expected exception 'cancelRowUpdates' not allowed because the ResultSet is not an updatable ResultSet.
Positive Test19 - Test updateRow method as the first updatable ResultSet api on a read-only resultset
Got expected exception : 'updateRow' not allowed because the ResultSet is not an updatable ResultSet.
Positive Test20 - Test updateXXX methods as the first updatable ResultSet api on a read-only resultset
Test updateShort on a readonly resultset
Using column position as first parameter to updateShort
Got expected exception : 'updateShort' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateShort
Got expected exception : 'updateShort' not allowed because the ResultSet is not an updatable ResultSet.
Test updateInt on a readonly resultset
Using column position as first parameter to updateInt
Got expected exception : 'updateInt' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateInt
Got expected exception : 'updateInt' not allowed because the ResultSet is not an updatable ResultSet.
Test updateLong on a readonly resultset
Using column position as first parameter to updateLong
Got expected exception : 'updateLong' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateLong
Got expected exception : 'updateLong' not allowed because the ResultSet is not an updatable ResultSet.
Test updateBigDecimal on a readonly resultset
Using column position as first parameter to updateBigDecimal
Got expected exception : 'updateBigDecimal' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateBigDecimal
Got expected exception : 'updateBigDecimal' not allowed because the ResultSet is not an updatable ResultSet.
Test updateFloat on a readonly resultset
Using column position as first parameter to updateFloat
Got expected exception : 'updateFloat' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateFloat
Got expected exception : 'updateFloat' not allowed because the ResultSet is not an updatable ResultSet.
Test updateDouble on a readonly resultset
Using column position as first parameter to updateDouble
Got expected exception : 'updateDouble' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateDouble
Got expected exception : 'updateDouble' not allowed because the ResultSet is not an updatable ResultSet.
Test updateString on a readonly resultset
Using column position as first parameter to updateString
Got expected exception : 'updateString' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateString
Got expected exception : 'updateString' not allowed because the ResultSet is not an updatable ResultSet.
Test updateAsciiStream on a readonly resultset
Using column position as first parameter to updateAsciiStream
Got expected exception : 'updateAsciiStream' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateAsciiStream
Got expected exception : 'updateAsciiStream' not allowed because the ResultSet is not an updatable ResultSet.
Test updateCharacterStream on a readonly resultset
Using column position as first parameter to updateCharacterStream
Got expected exception : 'updateCharacterStream' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateCharacterStream
Got expected exception : 'updateCharacterStream' not allowed because the ResultSet is not an updatable ResultSet.
Test updateByte on a readonly resultset
Using column position as first parameter to updateByte
Got expected exception : 'updateByte' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateByte
Got expected exception : 'updateByte' not allowed because the ResultSet is not an updatable ResultSet.
Test updateBytes on a readonly resultset
Using column position as first parameter to updateBytes
Got expected exception : 'updateBytes' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateBytes
Got expected exception : 'updateBytes' not allowed because the ResultSet is not an updatable ResultSet.
Test updateBinaryStream on a readonly resultset
Using column position as first parameter to updateBinaryStream
Got expected exception : 'updateBinaryStream' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateBinaryStream
Got expected exception : 'updateBinaryStream' not allowed because the ResultSet is not an updatable ResultSet.
Test updateClob on a readonly resultset
Using column position as first parameter to updateClob
Using column name as first parameter to updateClob
Test updateDate on a readonly resultset
Using column position as first parameter to updateDate
Got expected exception : 'updateDate' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateDate
Got expected exception : 'updateDate' not allowed because the ResultSet is not an updatable ResultSet.
Test updateTime on a readonly resultset
Using column position as first parameter to updateTime
Got expected exception : 'updateTime' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateTime
Got expected exception : 'updateTime' not allowed because the ResultSet is not an updatable ResultSet.
Test updateTimestamp on a readonly resultset
Using column position as first parameter to updateTimestamp
Got expected exception : 'updateTimestamp' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateTimestamp
Got expected exception : 'updateTimestamp' not allowed because the ResultSet is not an updatable ResultSet.
Test updateBlob on a readonly resultset
Using column position as first parameter to updateBlob
Using column name as first parameter to updateBlob
Test updateBoolean on a readonly resultset
Using column position as first parameter to updateBoolean
Got expected exception : 'updateBoolean' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateBoolean
Got expected exception : 'updateBoolean' not allowed because the ResultSet is not an updatable ResultSet.
Test updateNull on a readonly resultset
Using column position as first parameter to updateNull
Got expected exception : 'updateNull' not allowed because the ResultSet is not an updatable ResultSet.
Using column name as first parameter to updateNull
Got expected exception : 'updateNull' not allowed because the ResultSet is not an updatable ResultSet.
Test updateArray on a readonly resultset
Using column position as first parameter to updateArray
Using column name as first parameter to updateArray
Test updateRef on a readonly resultset
Using column position as first parameter to updateRef
Using column name as first parameter to updateRef
Positive Test21 - Test all updateXXX(excluding updateObject) methods on all the supported sql datatypes
Next datatype to test is SMALLINT
Testing updateShort on SQL type SMALLINT
Using column position as first parameter to updateShort
Using column name as first parameter to updateShort
Testing updateInt on SQL type SMALLINT
Using column position as first parameter to updateInt
Using column name as first parameter to updateInt
Testing updateLong on SQL type SMALLINT
Using column position as first parameter to updateLong
Using column name as first parameter to updateLong
Testing updateBigDecimal on SQL type SMALLINT
Using column position as first parameter to updateBigDecimal
Using column name as first parameter to updateBigDecimal
Testing updateFloat on SQL type SMALLINT
Using column position as first parameter to updateFloat
Using column name as first parameter to updateFloat
Testing updateDouble on SQL type SMALLINT
Using column position as first parameter to updateDouble
Using column name as first parameter to updateDouble
Testing updateString on SQL type SMALLINT
Using column position as first parameter to updateString
Using column name as first parameter to updateString
Testing updateAsciiStream on SQL type SMALLINT
Using column position as first parameter to updateAsciiStream
Got expected exception : An attempt was made to get a data value of type 'SMALLINT' from a data value of type 'java.io.InputStream'.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -