📄 updatableresultset.java
字号:
* if a database-access error occurs */ public synchronized void updateCharacterStream(String columnName, java.io.Reader reader, int length) throws SQLException { updateCharacterStream(findColumn(columnName), reader, length); } /** * @see ResultSet#updateClob(int, Clob) */ public void updateClob(int columnIndex, java.sql.Clob clob) throws SQLException { if (clob == null) { updateNull(columnIndex); } else { updateCharacterStream(columnIndex, clob.getCharacterStream(), (int) clob.length()); } } /** * JDBC 2.0 Update a column with a Date value. The updateXXX() methods are * used to update column values in the current row, or the insert row. The * updateXXX() methods do not update the underlying database, instead the * updateRow() or insertRow() methods are called to update the database. * * @param columnIndex * the first column is 1, the second is 2, ... * @param x * the new column value * * @exception SQLException * if a database-access error occurs */ public synchronized void updateDate(int columnIndex, java.sql.Date x) throws SQLException { if (!this.onInsertRow) { if (!this.doingUpdates) { this.doingUpdates = true; syncUpdate(); } this.updater.setDate(columnIndex, x); } else { this.inserter.setDate(columnIndex, x); this.thisRow[columnIndex - 1] = this.inserter .getBytesRepresentation(columnIndex - 1); } } /** * JDBC 2.0 Update a column with a Date value. The updateXXX() methods are * used to update column values in the current row, or the insert row. The * updateXXX() methods do not update the underlying database, instead the * updateRow() or insertRow() methods are called to update the database. * * @param columnName * the name of the column * @param x * the new column value * * @exception SQLException * if a database-access error occurs */ public synchronized void updateDate(String columnName, java.sql.Date x) throws SQLException { updateDate(findColumn(columnName), x); } /** * JDBC 2.0 Update a column with a Double value. The updateXXX() methods are * used to update column values in the current row, or the insert row. The * updateXXX() methods do not update the underlying database, instead the * updateRow() or insertRow() methods are called to update the database. * * @param columnIndex * the first column is 1, the second is 2, ... * @param x * the new column value * * @exception SQLException * if a database-access error occurs */ public synchronized void updateDouble(int columnIndex, double x) throws SQLException { if (!this.onInsertRow) { if (!this.doingUpdates) { this.doingUpdates = true; syncUpdate(); } this.updater.setDouble(columnIndex, x); } else { this.inserter.setDouble(columnIndex, x); this.thisRow[columnIndex - 1] = this.inserter .getBytesRepresentation(columnIndex - 1); } } /** * JDBC 2.0 Update a column with a double value. The updateXXX() methods are * used to update column values in the current row, or the insert row. The * updateXXX() methods do not update the underlying database, instead the * updateRow() or insertRow() methods are called to update the database. * * @param columnName * the name of the column * @param x * the new column value * * @exception SQLException * if a database-access error occurs */ public synchronized void updateDouble(String columnName, double x) throws SQLException { updateDouble(findColumn(columnName), x); } /** * JDBC 2.0 Update a column with a float value. The updateXXX() methods are * used to update column values in the current row, or the insert row. The * updateXXX() methods do not update the underlying database, instead the * updateRow() or insertRow() methods are called to update the database. * * @param columnIndex * the first column is 1, the second is 2, ... * @param x * the new column value * * @exception SQLException * if a database-access error occurs */ public synchronized void updateFloat(int columnIndex, float x) throws SQLException { if (!this.onInsertRow) { if (!this.doingUpdates) { this.doingUpdates = true; syncUpdate(); } this.updater.setFloat(columnIndex, x); } else { this.inserter.setFloat(columnIndex, x); this.thisRow[columnIndex - 1] = this.inserter .getBytesRepresentation(columnIndex - 1); } } /** * JDBC 2.0 Update a column with a float value. The updateXXX() methods are * used to update column values in the current row, or the insert row. The * updateXXX() methods do not update the underlying database, instead the * updateRow() or insertRow() methods are called to update the database. * * @param columnName * the name of the column * @param x * the new column value * * @exception SQLException * if a database-access error occurs */ public synchronized void updateFloat(String columnName, float x) throws SQLException { updateFloat(findColumn(columnName), x); } /** * JDBC 2.0 Update a column with an integer value. The updateXXX() methods * are used to update column values in the current row, or the insert row. * The updateXXX() methods do not update the underlying database, instead * the updateRow() or insertRow() methods are called to update the database. * * @param columnIndex * the first column is 1, the second is 2, ... * @param x * the new column value * * @exception SQLException * if a database-access error occurs */ public synchronized void updateInt(int columnIndex, int x) throws SQLException { if (!this.onInsertRow) { if (!this.doingUpdates) { this.doingUpdates = true; syncUpdate(); } this.updater.setInt(columnIndex, x); } else { this.inserter.setInt(columnIndex, x); this.thisRow[columnIndex - 1] = this.inserter .getBytesRepresentation(columnIndex - 1); } } /** * JDBC 2.0 Update a column with an integer value. The updateXXX() methods * are used to update column values in the current row, or the insert row. * The updateXXX() methods do not update the underlying database, instead * the updateRow() or insertRow() methods are called to update the database. * * @param columnName * the name of the column * @param x * the new column value * * @exception SQLException * if a database-access error occurs */ public synchronized void updateInt(String columnName, int x) throws SQLException { updateInt(findColumn(columnName), x); } /** * JDBC 2.0 Update a column with a long value. The updateXXX() methods are * used to update column values in the current row, or the insert row. The * updateXXX() methods do not update the underlying database, instead the * updateRow() or insertRow() methods are called to update the database. * * @param columnIndex * the first column is 1, the second is 2, ... * @param x * the new column value * * @exception SQLException * if a database-access error occurs */ public synchronized void updateLong(int columnIndex, long x) throws SQLException { if (!this.onInsertRow) { if (!this.doingUpdates) { this.doingUpdates = true; syncUpdate(); } this.updater.setLong(columnIndex, x); } else { this.inserter.setLong(columnIndex, x); this.thisRow[columnIndex - 1] = this.inserter .getBytesRepresentation(columnIndex - 1); } } /** * JDBC 2.0 Update a column with a long value. The updateXXX() methods are * used to update column values in the current row, or the insert row. The * updateXXX() methods do not update the underlying database, instead the * updateRow() or insertRow() methods are called to update the database. * * @param columnName * the name of the column * @param x * the new column value * * @exception SQLException * if a database-access error occurs */ public synchronized void updateLong(String columnName, long x) throws SQLException { updateLong(findColumn(columnName), x); } /** * JDBC 2.0 Give a nullable column a null value. The updateXXX() methods are * used to update column values in the current row, or the insert row. The * updateXXX() methods do not update the underlying database, instead the * updateRow() or insertRow() methods are called to update the database. * * @param columnIndex * the first column is 1, the second is 2, ... * * @exception SQLException * if a database-access error occurs */ public synchronized void updateNull(int columnIndex) throws SQLException { if (!this.onInsertRow) { if (!this.doingUpdates) { this.doingUpdates = true; syncUpdate(); } this.updater.setNull(columnIndex, 0); } else { this.inserter.setNull(columnIndex, 0); this.thisRow[columnIndex - 1] = null; } } /** * JDBC 2.0 Update a column with a null value. The updateXXX() methods are * used to update column values in the current row, or the insert row. The * updateXXX() methods do not update the underlying database, instead the * updateRow() or insertRow() methods are called to update the database. * * @param columnName * the name of the column * * @exception SQLException * if a database-access error occurs */ public synchronized void updateNull(String columnName) throws SQLException { updateNull(findColumn(columnName)); } /** * JDBC 2.0 Update a column with an Object value. The updateXXX() methods * are used to update column values in the current row, or the insert row. * The updateXXX() methods do not update the underlying database, instead * the updateRow() or insertRow() methods are called to update the database. * * @param columnIndex * the first column is 1, the second is 2, ... * @param x * the new column value * * @exception SQLException * if a database-access error occurs */ public synchronized void updateObject(int columnIndex, Object x) throws SQLException { if (!this.onInsertRow) { if (!this.doingUpdates) { this.doingUpdates = true; syncUpdate(); } this.updater.setObject(columnIndex, x); } else { this.inserter.setObject(columnIndex, x); this.thisRow[columnIndex - 1] = this.inserter .getBytesRepresentation(columnIndex - 1); } } /** * JDBC 2.0 Update a column with an Object value. The updateXXX() methods * are used to update column values in the current row, or the insert row. * The updateXXX() methods do not update the underlying database, instead * the updateRow() or insertRow() methods are called to update the database. * * @param columnIndex * the first column is 1, the second is 2, ... * @param x * the new column value * @param scale * For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types * this is the number of digits after the decimal. For all other * types this value will be ignored. * * @exception SQLException * if a database-access error occurs */ public synchronized void updateObject(int columnIndex, Object x, int scale) throws SQLException { if (!this.onInsertRow) { if (!this.doingUpdates) { this.doingUpdates = true; syncUpdate(); } this.updater.setObject(columnIndex, x); } else { this.inserter.setObject(columnIndex, x); this.thisRow[columnIndex - 1] = this.inserter .getBytesRepresentation(columnIndex - 1); } } /** * JDBC 2.0 Update a column with an Object value. The updateXXX() methods * are used to update column values in the current row, or the insert row. * The updateXXX() methods do not update the underlying database, instead * the updateRow() or insertRow() methods are called to update the database. * * @param columnName * the name of the column * @param x * the new column value * * @exception SQLException * if a database-access error occurs */ public synchronized void updateObject(String columnName, Object x) throws SQLException { updateObject(findColumn(columnName), x); } /** * JDBC 2.0 Update a column with an Object value. The updateXXX() methods * are used to update column values in the current row, or the insert row. * The updateXXX() methods do not update the underlying database, instead * the updateRow() or insertRow() methods are called to update the database. * * @param columnName * the name of the column * @param x * the new column value * @param scale * For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types * this is the number of digits after the decimal. For all other * types this value will be ignored. * * @exception SQLException * if a database-access error occurs */ public synchronized void updateObject(String columnName, Object x, int scale) throws SQLException { updateObject(findColumn(columnName), x); } /** * JDBC 2.0 Update the underlying database with the new contents of the * current row. Cannot be called when on the insert row. * * @exception SQLException * if a database-access error occurs, or if called when on * the insert row * @throws NotUpdatable * DOCUMENT ME! */ public synchronized void updateRow() throws SQLException { if (!this.isUpdatable) { throw new NotUpdatable(); } if (this.doingUpdates) { this.updater.executeUpdate(); refreshRow(); this.doingUpdates = false; } // // fixes calling updateRow() and then doing more // updates on same row..
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -