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

📄 preparedstatementwrapper.java

📁 mysql5.0 JDBC 驱动 放在glassfish或者tomcat的lib文件夹下就可以了
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
		try {			if (this.wrappedStmt != null) {				return ((PreparedStatement) this.wrappedStmt).execute();			}			throw SQLError.createSQLException(					"No operations allowed after statement closed",					SQLError.SQL_STATE_GENERAL_ERROR);		} 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.PreparedStatement#executeQuery()	 */	public ResultSet executeQuery() throws SQLException {		try {			if (this.wrappedStmt != null) {				ResultSet rs = ((PreparedStatement) this.wrappedStmt)						.executeQuery();				((com.mysql.jdbc.ResultSetInternalMethods) rs).setWrapperStatement(this);				return rs;			}			throw SQLError.createSQLException(					"No operations allowed after statement closed",					SQLError.SQL_STATE_GENERAL_ERROR);		} 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.PreparedStatement#executeUpdate()	 */	public int executeUpdate() throws SQLException {		try {			if (this.wrappedStmt != null) {				return ((PreparedStatement) this.wrappedStmt).executeUpdate();			}			throw SQLError.createSQLException(					"No operations allowed after statement closed",					SQLError.SQL_STATE_GENERAL_ERROR);		} catch (SQLException sqlEx) {			checkAndFireConnectionError(sqlEx);		}		return -1; // we actually never get here, but the compiler can't figure		// that out	}////	public void setAsciiStream(int parameterIndex, InputStream x)//			throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setAsciiStream(//						parameterIndex, x);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setAsciiStream(int parameterIndex, InputStream x, long length)//			throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setAsciiStream(//						parameterIndex, x, length);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setBinaryStream(int parameterIndex, InputStream x)//			throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setBinaryStream(//						parameterIndex, x);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setBinaryStream(int parameterIndex, InputStream x, long length)//			throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setBinaryStream(//						parameterIndex, x, length);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setBlob(int parameterIndex, InputStream inputStream)//			throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setBlob(parameterIndex,//						inputStream);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setBlob(int parameterIndex, InputStream inputStream, long length)//			throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setBlob(parameterIndex,//						inputStream, length);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setCharacterStream(int parameterIndex, Reader reader)//			throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setCharacterStream(//						parameterIndex, reader);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setCharacterStream(int parameterIndex, Reader reader,//			long length) throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setCharacterStream(//						parameterIndex, reader, length);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setClob(int parameterIndex, Reader reader) throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setClob(parameterIndex,//						reader);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setClob(int parameterIndex, Reader reader, long length)//			throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setClob(parameterIndex,//						reader, length);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setNCharacterStream(int parameterIndex, Reader value)//			throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setNCharacterStream(//						parameterIndex, value);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setNCharacterStream(int parameterIndex, Reader value,//			long length) throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setNCharacterStream(//						parameterIndex, value, length);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setNClob(int parameterIndex, NClob value) throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setNClob(parameterIndex,//						value);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setNClob(int parameterIndex, Reader reader) throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setNClob(parameterIndex,//						reader);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setNClob(int parameterIndex, Reader reader, long length)//			throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setNClob(parameterIndex,//						reader, length);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setNString(int parameterIndex, String value)//			throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setNString(//						parameterIndex, value);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setRowId(int parameterIndex, RowId x) throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setRowId(parameterIndex,//						x);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public void setSQLXML(int parameterIndex, SQLXML xmlObject)//			throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setSQLXML(//						parameterIndex, xmlObject);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public boolean isClosed() throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				return ((PreparedStatement) this.wrappedStmt).isClosed();//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}////		return true;//	}////	public boolean isPoolable() throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				return ((PreparedStatement) this.wrappedStmt).isPoolable();//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}////		return false;//	}////	public void setPoolable(boolean poolable) throws SQLException {//		try {//			if (this.wrappedStmt != null) {//				((PreparedStatement) this.wrappedStmt).setPoolable(poolable);//			} else {//				throw SQLError.createSQLException(//						"No operations allowed after statement closed",//						SQLError.SQL_STATE_GENERAL_ERROR);//			}//		} catch (SQLException sqlEx) {//			checkAndFireConnectionError(sqlEx);//		}//	}////	public boolean isWrapperFor(Class arg0) throws SQLException {//		throw SQLError.notImplemented();//	}////	public Object unwrap(Class arg0) throws SQLException {//		throw SQLError.notImplemented();//	}}

⌨️ 快捷键说明

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