commonpreparedstatement.java

来自「工厂版本管理系统,STRUTS2框架,用于管理商品的版本,便于有效的控制版本」· Java 代码 · 共 710 行 · 第 1/2 页

JAVA
710
字号
	/* (非 Javadoc)
	 * @see java.sql.Statement#getResultSetHoldability()
	 */
	public int getResultSetHoldability() throws SQLException {
		return ps.getResultSetHoldability();
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#getResultSetType()
	 */
	public int getResultSetType() throws SQLException {
		return ps.getResultSetType();
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#getUpdateCount()
	 */
	public int getUpdateCount() throws SQLException {
		return ps.getUpdateCount();
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#cancel()
	 */
	public void cancel() throws SQLException {
		ps.cancel();
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#clearBatch()
	 */
	public void clearBatch() throws SQLException {
		ps.clearBatch();
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#clearWarnings()
	 */
	public void clearWarnings() throws SQLException {
		ps.clearWarnings();
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#close()
	 */
	public void close() throws SQLException {
		ps.close();
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#getMoreResults()
	 */
	public boolean getMoreResults() throws SQLException {
		return ps.getMoreResults();
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#executeBatch()
	 */
	public int[] executeBatch() throws SQLException {
		return ps.executeBatch();
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#setFetchDirection(int)
	 */
	public void setFetchDirection(int direction) throws SQLException {
		ps.setFetchDirection(direction);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#setFetchSize(int)
	 */
	public void setFetchSize(int rows) throws SQLException {
		ps.setFetchSize(rows);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#setMaxFieldSize(int)
	 */
	public void setMaxFieldSize(int max) throws SQLException {
		ps.setMaxFieldSize(max);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#setMaxRows(int)
	 */
	public void setMaxRows(int max) throws SQLException {
		ps.setMaxRows(max);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#setQueryTimeout(int)
	 */
	public void setQueryTimeout(int seconds) throws SQLException {
		ps.setQueryTimeout(seconds);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#getMoreResults(int)
	 */
	public boolean getMoreResults(int current) throws SQLException {
		return ps.getMoreResults(current);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#setEscapeProcessing(boolean)
	 */
	public void setEscapeProcessing(boolean enable) throws SQLException {
		ps.setEscapeProcessing(enable);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#executeUpdate(java.lang.String)
	 */
	public int executeUpdate(String sql) throws SQLException {
		return ps.executeUpdate(sql);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#addBatch(java.lang.String)
	 */
	public void addBatch(String sql) throws SQLException {
		ps.addBatch(sql);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#setCursorName(java.lang.String)
	 */
	public void setCursorName(String name) throws SQLException {
		ps.setCursorName(name);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#execute(java.lang.String)
	 */
	public boolean execute(String sql) throws SQLException {
		return ps.execute(sql);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#executeUpdate(java.lang.String, int)
	 */
	public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
		return ps.executeUpdate(sql, autoGeneratedKeys);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#execute(java.lang.String, int)
	 */
	public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
		return ps.execute(sql, autoGeneratedKeys);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#executeUpdate(java.lang.String, int[])
	 */
	public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
		return ps.executeUpdate(sql, columnIndexes);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#execute(java.lang.String, int[])
	 */
	public boolean execute(String sql, int[] columnIndexes) throws SQLException {
		return ps.execute(sql, columnIndexes);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#getConnection()
	 */
	public Connection getConnection() throws SQLException {
		return ps.getConnection();
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#getGeneratedKeys()
	 */
	public ResultSet getGeneratedKeys() throws SQLException {
		return new CommonResultSet(ps.getGeneratedKeys(), param);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#getResultSet()
	 */
	public ResultSet getResultSet() throws SQLException {
		return new CommonResultSet(ps.getResultSet(), param);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#getWarnings()
	 */
	public SQLWarning getWarnings() throws SQLException {
		return ps.getWarnings();
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#executeUpdate(java.lang.String, java.lang.String[])
	 */
	public int executeUpdate(String sql, String[] columnNames) throws SQLException {
		return ps.executeUpdate(sql, columnNames);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#execute(java.lang.String, java.lang.String[])
	 */
	public boolean execute(String sql, String[] columnNames) throws SQLException {
		return ps.execute(sql, columnNames);
	}

	/* (非 Javadoc)
	 * @see java.sql.Statement#executeQuery(java.lang.String)
	 */
	public ResultSet executeQuery(String sql) throws SQLException {
		return new CommonResultSet(ps.executeQuery(sql), param);
	}
	
	private Object processChinese(Object x) throws SQLException {
		if (x instanceof String) {
			return processChineseString(Java2Db.convert2db((String)x, param) );
		}
		return x;
	}
	
	private String processChineseString(String x) throws SQLException {
		String str = x;
		if (param.get("usetrim") != null && param.get("usetrim").equals("yes") && x != null) {
			str = str.trim();
			int count = 0;
			int length = str.length();
			for (int i = 0; i < length; i++) {
				if ((str.charAt(i)) > 255)
					count++;
			}
			return x.length() - str.length() >= count ? x.substring(0, x.length() - count) : x;
		} else {
			return x;
		}
	}

	public void setAsciiStream(int parameterIndex, InputStream x)
			throws SQLException {
		ps.setAsciiStream(parameterIndex, x);
				
	}

	public void setAsciiStream(int parameterIndex, InputStream x, long length)
			throws SQLException {
		ps.setAsciiStream(parameterIndex, x, length);
		
	}

	public void setBinaryStream(int parameterIndex, InputStream x)
			throws SQLException {
		ps.setBinaryStream(parameterIndex, x);
	}

	public void setBinaryStream(int parameterIndex, InputStream x, long length)
			throws SQLException {
		ps.setBinaryStream(parameterIndex, x, length);
	}

	public void setBlob(int parameterIndex, InputStream inputStream)
			throws SQLException {
		ps.setBlob(parameterIndex, inputStream);
	}

	public void setBlob(int parameterIndex, InputStream inputStream, long length)
			throws SQLException {
		ps.setBlob(parameterIndex, inputStream, length);
		
	}

	public void setCharacterStream(int parameterIndex, Reader reader)
			throws SQLException {
		ps.setCharacterStream(parameterIndex, reader);
	}

	public void setCharacterStream(int parameterIndex, Reader reader,
			long length) throws SQLException {
		ps.setCharacterStream(parameterIndex, reader, length);
		
	}

	public void setClob(int parameterIndex, Reader reader) throws SQLException {
		ps.setClob(parameterIndex, reader);
		
	}

	public void setClob(int parameterIndex, Reader reader, long length)
			throws SQLException {
		ps.setClob(parameterIndex, reader, length);
	}

	public void setNCharacterStream(int parameterIndex, Reader value)
			throws SQLException {
		ps.setNCharacterStream(parameterIndex, value);
		
	}

	public void setNCharacterStream(int parameterIndex, Reader value,
			long length) throws SQLException {
		ps.setNCharacterStream(parameterIndex, value, length);
		
	}

	public void setNClob(int parameterIndex, NClob value) throws SQLException {
		ps.setNClob(parameterIndex, value);
		
	}

	public void setNClob(int parameterIndex, Reader reader) throws SQLException {
		ps.setNClob(parameterIndex, reader);
	}

	public void setNClob(int parameterIndex, Reader reader, long length)
			throws SQLException {
		ps.setNClob(parameterIndex, reader, length);
	}

	public void setNString(int parameterIndex, String value)
			throws SQLException {
		ps.setNString(parameterIndex, value);
	}

	public void setRowId(int parameterIndex, RowId x) throws SQLException {
		ps.setRowId(parameterIndex, x);
	}

	public void setSQLXML(int parameterIndex, SQLXML xmlObject)
			throws SQLException {
		ps.setSQLXML(parameterIndex, xmlObject);
	}

	public boolean isClosed() throws SQLException {
		return ps.isClosed();
	}

	public boolean isPoolable() throws SQLException {
		return ps.isPoolable();
	}

	public void setPoolable(boolean poolable) throws SQLException {
		ps.setPoolable(poolable);
	}

	public boolean isWrapperFor(Class<?> iface) throws SQLException {
		return ps.isWrapperFor(iface);
	}

	public <T> T unwrap(Class<T> iface) throws SQLException {
		return ps.unwrap(iface);
	}
}

⌨️ 快捷键说明

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