⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 statementwrapper.java

📁 mysql5.0 JDBC 驱动 放在glassfish或者tomcat的lib文件夹下就可以了
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
		return null;	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#getResultSetConcurrency()	 */	public int getResultSetConcurrency() throws SQLException {		try {			if (this.wrappedStmt != null) {				return this.wrappedStmt.getResultSetConcurrency();			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return 0;	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#getResultSetHoldability()	 */	public int getResultSetHoldability() throws SQLException {		try {			if (this.wrappedStmt != null) {				return this.wrappedStmt.getResultSetHoldability();			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return Statement.CLOSE_CURRENT_RESULT;	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#getResultSetType()	 */	public int getResultSetType() throws SQLException {		try {			if (this.wrappedStmt != null) {				return this.wrappedStmt.getResultSetType();			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return ResultSet.TYPE_FORWARD_ONLY;	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#getUpdateCount()	 */	public int getUpdateCount() throws SQLException {		try {			if (this.wrappedStmt != null) {				return this.wrappedStmt.getUpdateCount();			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return -1;	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#getWarnings()	 */	public SQLWarning getWarnings() throws SQLException {		try {			if (this.wrappedStmt != null) {				return this.wrappedStmt.getWarnings();			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return null;	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#addBatch(java.lang.String)	 */	public void addBatch(String sql) throws SQLException {		try {			if (this.wrappedStmt != null) {				this.wrappedStmt.addBatch(sql);			}		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#cancel()	 */	public void cancel() throws SQLException {		try {			if (this.wrappedStmt != null) {				this.wrappedStmt.cancel();			}		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#clearBatch()	 */	public void clearBatch() throws SQLException {		try {			if (this.wrappedStmt != null) {				this.wrappedStmt.clearBatch();			}		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#clearWarnings()	 */	public void clearWarnings() throws SQLException {		try {			if (this.wrappedStmt != null) {				this.wrappedStmt.clearWarnings();			}		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#close()	 */	public void close() throws SQLException {		try {			if (this.wrappedStmt != null) {				this.wrappedStmt.close();			}		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		} finally {			this.wrappedStmt = null;			this.pooledConnection = null;		}	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#execute(java.lang.String, int)	 */	public boolean execute(String sql, int autoGeneratedKeys)			throws SQLException {		try {			if (this.wrappedStmt != null) {				return this.wrappedStmt.execute(sql, autoGeneratedKeys);			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return false; // we actually never get here, but the compiler can't						// figure		// that out	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#execute(java.lang.String, int[])	 */	public boolean execute(String sql, int[] columnIndexes) throws SQLException {		try {			if (this.wrappedStmt != null) {				return this.wrappedStmt.execute(sql, columnIndexes);			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return false; // we actually never get here, but the compiler can't						// figure		// that out	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#execute(java.lang.String, java.lang.String[])	 */	public boolean execute(String sql, String[] columnNames)			throws SQLException {		try {			if (this.wrappedStmt != null) {				return this.wrappedStmt.execute(sql, columnNames);			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return false; // we actually never get here, but the compiler can't						// figure		// that out	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#execute(java.lang.String)	 */	public boolean execute(String sql) throws SQLException {		try {			if (this.wrappedStmt != null) {				return this.wrappedStmt.execute(sql);			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return false; // we actually never get here, but the compiler can't						// figure		// that out	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#executeBatch()	 */	public int[] executeBatch() throws SQLException {		try {			if (this.wrappedStmt != null) {				return this.wrappedStmt.executeBatch();			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return null; // we actually never get here, but the compiler can't						// figure		// that out	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#executeQuery(java.lang.String)	 */	public ResultSet executeQuery(String sql) throws SQLException {		try {			if (this.wrappedStmt != null) {				ResultSet rs = this.wrappedStmt.executeQuery(sql);				((com.mysql.jdbc.ResultSetInternalMethods) rs).setWrapperStatement(this);				return rs;			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return null; // we actually never get here, but the compiler can't						// figure		// that out	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#executeUpdate(java.lang.String, int)	 */	public int executeUpdate(String sql, int autoGeneratedKeys)			throws SQLException {		try {			if (this.wrappedStmt != null) {				return this.wrappedStmt.executeUpdate(sql, autoGeneratedKeys);			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return -1; // we actually never get here, but the compiler can't figure		// that out	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#executeUpdate(java.lang.String, int[])	 */	public int executeUpdate(String sql, int[] columnIndexes)			throws SQLException {		try {			if (this.wrappedStmt != null) {				return this.wrappedStmt.executeUpdate(sql, columnIndexes);			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return -1; // we actually never get here, but the compiler can't figure		// that out	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#executeUpdate(java.lang.String,	 *      java.lang.String[])	 */	public int executeUpdate(String sql, String[] columnNames)			throws SQLException {		try {			if (this.wrappedStmt != null) {				return this.wrappedStmt.executeUpdate(sql, columnNames);			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return -1; // we actually never get here, but the compiler can't figure		// that out	}	/*	 * (non-Javadoc)	 * 	 * @see java.sql.Statement#executeUpdate(java.lang.String)	 */	public int executeUpdate(String sql) throws SQLException {		try {			if (this.wrappedStmt != null) {				return this.wrappedStmt.executeUpdate(sql);			}			throw SQLError.createSQLException("Statement already closed",					SQLError.SQL_STATE_ILLEGAL_ARGUMENT);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return -1; // we actually never get here, but the compiler can't figure		// that out	}	public void enableStreamingResults() throws SQLException {		try {			if (this.wrappedStmt != null) {				((com.mysql.jdbc.Statement) this.wrappedStmt)						.enableStreamingResults();			} else {				throw SQLError.createSQLException(						"No operations allowed after statement closed",						SQLError.SQL_STATE_GENERAL_ERROR);			}		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -