sql >> データベース >  >> RDS >> Oracle

ojdbc14 から ojdbc6 へのアップグレードでのオブジェクトのデシリアライゼーションの失敗

    ** お急ぎの場合は、カスタマイズした ojdbc6.jar ファイルをダウンロードして使用してください。他に何もする必要はありません。

    https://drive.google.com/open?id=0Bz2PT96Cb0tSRk5XNGU3TUdHS1U

    私の回答のまとめ

    <オール> <リ>

    まず、以下のクラスを逆コンパイルします。

    • oracle.sql.DatumWithConnection.class

    • oracle.sql.BLOB.class

    <リ>

    次に、古い serialVersionUID をこれらのクラスに追加します (古いバージョンの ID はエラー ログで確認できます)。

  1. その後、クラスを再コンパイルします。
  2. 最後に、ojdbc6.jar を新しいクラスで更新して、アップグレードおよびカスタマイズされた ojdbc ライブラリを取得します。以上です。
  3. JAR を手動でビルドする場合は、以下の手順を読んでそれに従ってください。

    カスタマイズされた JAR をビルドする方法

    <オール> <リ>

    まず、ojdbc6.jar ファイル内の以下のクラスを逆コンパイルします。

    • oracle.sql.DatumWithConnection.class

    • oracle.sql.BLOB.class

    逆コンパイルするには、http://jd.benow.ca/ で「Java Decompiler」を使用できます。

    (これらのクラスは、保存された BLOB オブジェクトをデータベースから読み取る際に問題を引き起こしていました。)

    1. Eclipse で単純な Java プロジェクト (File--> New--> JavaProject) を作成するか、単純なプロジェクト 私が作成しました。

    新しいプロジェクトを作成する場合は、逆コンパイルされた Java ファイルを適切なパッケージ構造 (oracle.sql) で追加します。また、ojdbc6.jar ファイルをこのプロジェクトのビルド パスに追加する必要があります。

      <リ>

      次に、これらの逆コンパイルされた Java ファイルに古い serialVersionUID を追加します (これらの Java ファイルをコンパイルするには、追加の変更も必要です。以下の更新された Java ファイルを参照してください)。

       DatumWithConnection.java ->    private static final long serialVersionUID = 491462912477014233L;
      
       BLOB.java          ->  private static final long serialVersionUID = 2160152488501369185L;
      
      <リ>

      その後、プロジェクトをビルドし、再コンパイルされたクラスを取得します。

      <リ>

      最後に、ojdbc6.jar を新しいクラスで更新して、アップグレードおよびカスタマイズされた ojdbc ライブラリを取得します。以上です

      5.1 「Updated JAR」という名前の新しいフォルダーを作成します。

      5.2 ojdbc6.jar ファイルをそのフォルダーにコピーします。D:\JARS\Updated JAR\ojdbc.jar

      5.3 そのフォルダの下に、クラス ファイルのパッケージ構造を構築するための 2 つの新しいフォルダを作成します (\oracle\sql)

      5.4 両方のクラス ファイルを「sql」フォルダに追加します。

       D:\JARS\Updated JAR\oracle\sql\DatumWithConnection.class
      
       D:\JARS\Updated JAR\oracle\sql\BLOB.class
      

      5.5 新しいコマンドラインを開き、ディレクトリ (cd) を jar ファイルがある場所に変更します。

      >cd D:\JARS\Updated JAR
      

      5.6 jar ファイルを新しいクラス ファイルで更新するには、コマンド ラインで以下のコマンドを使用します。

      >jar uf ojdbc6.jar oracle\sql\DatumWithConnection.class
      
      >jar uf ojdbc6.jar oracle\sql\BLOB.class
      

      5.7 これで、シリアル化され ojdbc14.jar で保存された BLOB オブジェクトで動作するカスタマイズされた ojdbc6.jar ファイルができました

    Java クラスを更新しました。

    DatumWithConnection.java

        package oracle.sql;
    
    
        import java.sql.Connection;
        import java.sql.SQLException;
        import oracle.jdbc.driver.DatabaseError;
        import oracle.jdbc.driver.OracleDriver;
        import oracle.jdbc.internal.OracleDatumWithConnection;
    
        public abstract class DatumWithConnection
          extends Datum
          implements OracleDatumWithConnection
        {
    
        private static final long serialVersionUID = 491462912477014233L;
    
        private oracle.jdbc.internal.OracleConnection physicalConnection = null;
    
          oracle.jdbc.internal.OracleConnection getPhysicalConnection()
          {
            if (this.physicalConnection == null) {
              try
              {
                this.physicalConnection = ((oracle.jdbc.internal.OracleConnection)new OracleDriver().defaultConnection());
              }
              catch (SQLException localSQLException) {}
            }
            return this.physicalConnection;
          }
    
          public DatumWithConnection(byte[] paramArrayOfByte)
            throws SQLException
          {
            super(paramArrayOfByte);
          }
    
          public DatumWithConnection() {}
    
          public static void assertNotNull(Connection paramConnection)
            throws SQLException
          {
            if (paramConnection == null)
            {
              SQLException localSQLException = DatabaseError.createSqlException(null, 68, "Connection is null");
              localSQLException.fillInStackTrace();
              throw localSQLException;
            }
          }
    
          public static void assertNotNull(TypeDescriptor paramTypeDescriptor)
            throws SQLException
          {
            if (paramTypeDescriptor == null)
            {
              SQLException localSQLException = DatabaseError.createSqlException(null, 61);
              localSQLException.fillInStackTrace();
              throw localSQLException;
            }
          }
    
          public void setPhysicalConnectionOf(Connection paramConnection)
          {
            this.physicalConnection = ((oracle.jdbc.OracleConnection)paramConnection).physicalConnectionWithin();
          }
    
          public Connection getJavaSqlConnection()
            throws SQLException
          {
            return getPhysicalConnection().getWrapper();
          }
    
          public oracle.jdbc.OracleConnection getOracleConnection()
            throws SQLException
          {
            return getPhysicalConnection().getWrapper();
          }
    
          public oracle.jdbc.internal.OracleConnection getInternalConnection()
            throws SQLException
          {
            return getPhysicalConnection();
          }
    
          /**
           * @deprecated
           */
          public oracle.jdbc.driver.OracleConnection getConnection()
            throws SQLException
          {
            oracle.jdbc.driver.OracleConnection localOracleConnection = null;
            try
            {
              localOracleConnection = (oracle.jdbc.driver.OracleConnection)((oracle.jdbc.driver.OracleConnection)this.physicalConnection).getWrapper();
            }
            catch (ClassCastException localClassCastException)
            {
              SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 103);
              localSQLException.fillInStackTrace();
              throw localSQLException;
            }
            return localOracleConnection;
          }
    
          protected oracle.jdbc.internal.OracleConnection getConnectionDuringExceptionHandling()
          {
            return this.physicalConnection;
          }
    
          private static final String _Copyright_2007_Oracle_All_Rights_Reserved_ = null;
          public static final boolean TRACE = false;
        }
    

    BLOB.java

        package oracle.sql;
    
        import java.io.ByteArrayInputStream;
        import java.io.InputStream;
        import java.io.OutputStream;
        import java.io.Reader;
        import java.sql.Blob;
        import java.sql.Connection;
        import java.sql.SQLException;
        import oracle.jdbc.LargeObjectAccessMode;
        import oracle.jdbc.driver.DatabaseError;
        import oracle.jdbc.internal.OracleBlob;
    
        public class BLOB extends DatumWithConnection implements OracleBlob {
    
            private static final long serialVersionUID = 2160152488501369185L;
    
            public static final int MAX_CHUNK_SIZE = 32768;
            public static final int DURATION_SESSION = 10;
            public static final int DURATION_CALL = 12;
            static final int OLD_WRONG_DURATION_SESSION = 1;
            static final int OLD_WRONG_DURATION_CALL = 2;
            public static final int MODE_READONLY = 0;
            public static final int MODE_READWRITE = 1;
            BlobDBAccess dbaccess;
            int dbChunkSize;
            boolean isFree;
            boolean fromObject;
            private long cachedLobLength;
            private byte[] prefetchData;
            private int prefetchDataSize;
            private boolean activePrefetch;
            static final int KDLCTLSIZE = 16;
            static final int KDF_FLAG = 88;
            static final int KDLIDDAT = 8;
            private static final String _Copyright_2007_Oracle_All_Rights_Reserved_ = null;
            public static final boolean TRACE = false;
            public static Object localObject;
    
    
            protected BLOB() {
                this.dbChunkSize = -1;
                this.isFree = false;
    
                this.fromObject = false;
    
                this.cachedLobLength = -1L;
    
                this.prefetchDataSize = 0;
                this.activePrefetch = false;
            }
    
            public BLOB(oracle.jdbc.OracleConnection paramOracleConnection) throws SQLException {
                this(paramOracleConnection, null);
            }
    
            public BLOB(oracle.jdbc.OracleConnection paramOracleConnection, byte[] paramArrayOfByte, boolean paramBoolean)
                    throws SQLException {
                this(paramOracleConnection, paramArrayOfByte);
    
                this.fromObject = paramBoolean;
            }
    
            public BLOB(oracle.jdbc.OracleConnection paramOracleConnection, byte[] paramArrayOfByte) throws SQLException {
                super(paramArrayOfByte);
    
                this.dbChunkSize = -1;
                this.isFree = false;
    
                this.fromObject = false;
    
                this.cachedLobLength = -1L;
    
                this.prefetchDataSize = 0;
                this.activePrefetch = false;
    
                assertNotNull(paramOracleConnection);
                setPhysicalConnectionOf(paramOracleConnection);
    
                this.dbaccess = getPhysicalConnection().createBlobDBAccess();
    
                this.dbaccess.incrementTempLobReferenceCount(paramArrayOfByte);
            }
    
            public long length() throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                long l = -1L;
    
                if ((this.activePrefetch) && (this.cachedLobLength != -1L))
                    l = this.cachedLobLength;
                else if (canReadBasicLobDataInLocator())
                    l = dilLength();
                else
                    l = getDBAccess().length(this);
                return l;
            }
    
            public byte[] getBytes(long paramLong, int paramInt) throws SQLException {
                if (this.isFree) {
                    localObject = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 192);
                    ((SQLException) localObject).fillInStackTrace();
                    throw ((SQLException) localObject);
                }
                if ((paramInt < 0) || (paramLong < 1L)) {
                    localObject = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 68, "getBytes()");
                    ((SQLException) localObject).fillInStackTrace();
                    throw ((SQLException) localObject);
                }
    
                if (canReadBasicLobDataInLocator()) {
                    return dilGetBytes(paramLong, paramInt);
                }
    
                Object localObject = null;
    
                if (paramInt == 0) {
                    return new byte[0];
                }
                if ((this.activePrefetch) && (((this.cachedLobLength == 0L)
                        || ((this.cachedLobLength > 0L) && (paramLong - 1L >= this.cachedLobLength))))) {
                    localObject = null;
                } else {
                    long l = 0L;
                    byte[] arrayOfByte;
                    if ((this.activePrefetch) && (this.cachedLobLength != -1L))
                        arrayOfByte = new byte[Math.min((int) this.cachedLobLength, paramInt)];
                    else {
                        arrayOfByte = new byte[paramInt];
                    }
    
                    l = getBytes(paramLong, paramInt, arrayOfByte);
    
                    if (l > 0L) {
                        if (l == paramInt) {
                            localObject = arrayOfByte;
                        } else {
                            localObject = new byte[(int) l];
    
                            System.arraycopy(arrayOfByte, 0, localObject, 0, (int) l);
                        }
                    }
                }
    
                return ((byte[])localObject);
            }
    
            public InputStream getBinaryStream() throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                if (canReadBasicLobDataInLocator()) {
                    return dilGetBinaryStream(1L);
                }
                return getDBAccess().newInputStream(this, getBufferSize(), 0L);
            }
    
            public long position(byte[] paramArrayOfByte, long paramLong) throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                return getDBAccess().position(this, paramArrayOfByte, paramLong);
            }
    
            public long position(Blob paramBlob, long paramLong) throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                return getDBAccess().position(this, (BLOB) paramBlob, paramLong);
            }
    
            public int getBytes(long paramLong, int paramInt, byte[] paramArrayOfByte) throws SQLException {
                SQLException localSQLException;
                if (this.isFree) {
                    localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                if ((paramInt < 0) || (paramLong < 0L)) {
                    localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 68,
                            "getBytes()");
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
    
                if (paramArrayOfByte.length < paramInt) {
                    paramInt = paramArrayOfByte.length;
                }
                return getDBAccess().getBytes(this, paramLong, paramInt, paramArrayOfByte);
            }
    
            public int putBytes(long paramLong, byte[] paramArrayOfByte) throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                return setBytes(paramLong, paramArrayOfByte);
            }
    
            public int putBytes(long paramLong, byte[] paramArrayOfByte, int paramInt) throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                return setBytes(paramLong, paramArrayOfByte, 0, paramInt);
            }
    
            public OutputStream getBinaryOutputStream() throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                return setBinaryStream(1L);
            }
    
            public byte[] getLocator() {
                return getBytes();
            }
    
            public void setLocator(byte[] paramArrayOfByte) {
                setBytes(paramArrayOfByte);
            }
    
            public int getChunkSize() throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                if (this.dbChunkSize <= 0) {
                    this.dbChunkSize = getDBAccess().getChunkSize(this);
                }
    
                return this.dbChunkSize;
            }
    
            public int getBufferSize() throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                int i = getChunkSize();
                int j = i;
    
                if ((i >= 32768) || (i <= 0)) {
                    j = 32768;
                } else {
                    j = 32768 / i * i;
                }
    
                return j;
            }
    
            public static BLOB empty_lob() throws SQLException {
                return getEmptyBLOB();
            }
    
            public static BLOB getEmptyBLOB() throws SQLException {
                byte[] arrayOfByte = new byte[86];
    
                arrayOfByte[1] = 84;
                arrayOfByte[5] = 24;
    
                BLOB localBLOB = new BLOB();
    
                localBLOB.setShareBytes(arrayOfByte);
    
                return localBLOB;
            }
    
            public boolean isEmptyLob() throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                boolean bool = (shareBytes()[5] & 0x10) != 0;
    
                return bool;
            }
    
            public boolean isSecureFile() throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                boolean bool = (shareBytes()[7] & 0xFFFFFF80) != 0;
                return bool;
            }
    
            public OutputStream getBinaryOutputStream(long paramLong) throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                return getDBAccess().newOutputStream(this, getBufferSize(), paramLong, false);
            }
    
            public InputStream getBinaryStream(long paramLong) throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                if (canReadBasicLobDataInLocator()) {
                    return dilGetBinaryStream(paramLong);
                }
                return getDBAccess().newInputStream(this, getBufferSize(), paramLong);
            }
    
            public void trim(long paramLong) throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                truncate(paramLong);
            }
    
            public static BLOB createTemporary(Connection paramConnection, boolean paramBoolean, int paramInt)
                    throws SQLException {
                int i = paramInt;
    
                if (paramInt == 1) {
                    i = 10;
                }
                if (paramInt == 2) {
                    i = 12;
                }
                if ((paramConnection == null) || ((i != 10) && (i != 12))) {
                    localObject = DatabaseError.createSqlException(null, 68,
                            "'conn' should not be null and 'duration' should either be equal to DURATION_SESSION or to DURATION_CALL");
    
                    ((SQLException) localObject).fillInStackTrace();
                    throw ((SQLException) localObject);
                }
    
                Object localObject = ((oracle.jdbc.OracleConnection) paramConnection).physicalConnectionWithin();
    
                return ((BLOB) getDBAccess((Connection) localObject).createTemporaryBlob((Connection) localObject, paramBoolean,
                        i));
            }
    
            public static void freeTemporary(BLOB paramBLOB) throws SQLException {
                if (paramBLOB == null) {
                    return;
                }
                paramBLOB.freeTemporary();
            }
    
            public static boolean isTemporary(BLOB paramBLOB) throws SQLException {
                if (paramBLOB == null) {
                    return false;
                }
                return paramBLOB.isTemporary();
            }
    
            public void freeTemporary() throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
    
                int i = getDBAccess().decrementTempLobReferenceCount(shareBytes());
    
                if (i == 0)
                    getDBAccess().freeTemporary(this, this.fromObject);
            }
    
            public boolean isTemporary() throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                return getDBAccess().isTemporary(this);
            }
    
            public void open(LargeObjectAccessMode paramLargeObjectAccessMode) throws SQLException {
                open(paramLargeObjectAccessMode.getCode());
            }
    
            public void open(int paramInt) throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                getDBAccess().open(this, paramInt);
            }
    
            public void close() throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                getDBAccess().close(this);
            }
    
            public boolean isOpen() throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                return getDBAccess().isOpen(this);
            }
    
            public int setBytes(long paramLong, byte[] paramArrayOfByte) throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
    
                return getDBAccess().putBytes(this, paramLong, paramArrayOfByte, 0,
                        (paramArrayOfByte != null) ? paramArrayOfByte.length : 0);
            }
    
            public int setBytes(long paramLong, byte[] paramArrayOfByte, int paramInt1, int paramInt2) throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                return getDBAccess().putBytes(this, paramLong, paramArrayOfByte, paramInt1, paramInt2);
            }
    
            public OutputStream setBinaryStream(long paramLong) throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                return getDBAccess().newOutputStream(this, getBufferSize(), paramLong, true);
            }
    
            public void truncate(long paramLong) throws SQLException {
                SQLException localSQLException;
                if (this.isFree) {
                    localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                if (paramLong < 0L) {
                    localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 68,
                            "'len' should be >= 0. ");
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
    
                getDBAccess().trim(this, paramLong);
            }
    
            public Object toJdbc() throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                return this;
            }
    
            public boolean isConvertibleTo(Class paramClass) {
                String str = paramClass.getName();
    
                return ((str.compareTo("java.io.InputStream") == 0) || (str.compareTo("java.io.Reader") == 0));
            }
    
            public Reader characterStreamValue() throws SQLException {
                getInternalConnection();
                return getDBAccess().newConversionReader(this, 8);
            }
    
            public InputStream asciiStreamValue() throws SQLException {
                getInternalConnection();
                return getDBAccess().newConversionInputStream(this, 2);
            }
    
            public InputStream binaryStreamValue() throws SQLException {
                return getBinaryStream();
            }
    
            public Object makeJdbcArray(int paramInt) {
                return new BLOB[paramInt];
            }
    
            public BlobDBAccess getDBAccess() throws SQLException {
                SQLException localSQLException;
                if (this.dbaccess == null) {
                    if (isEmptyLob()) {
                        localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 98);
                        localSQLException.fillInStackTrace();
                        throw localSQLException;
                    }
    
                    this.dbaccess = getInternalConnection().createBlobDBAccess();
                }
    
                if (getPhysicalConnection().isClosed()) {
                    localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 8);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
    
                return this.dbaccess;
            }
    
            public static BlobDBAccess getDBAccess(Connection paramConnection) throws SQLException {
                return ((oracle.jdbc.OracleConnection) paramConnection).physicalConnectionWithin().createBlobDBAccess();
            }
    
            public Connection getJavaSqlConnection() throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException.fillInStackTrace();
                    throw localSQLException;
                }
                return super.getJavaSqlConnection();
            }
    
            public final void setLength(long paramLong) {
                this.cachedLobLength = paramLong;
            }
    
            public final void setChunkSize(int paramInt) {
                this.dbChunkSize = paramInt;
            }
    
            public final void setPrefetchedData(byte[] paramArrayOfByte) {
                if (paramArrayOfByte == null)
                    setPrefetchedData(null, 0);
                else
                    setPrefetchedData(paramArrayOfByte, paramArrayOfByte.length);
            }
    
            public final void setPrefetchedData(byte[] paramArrayOfByte, int paramInt) {
                this.prefetchData = paramArrayOfByte;
                this.prefetchDataSize = paramInt;
            }
    
            public final byte[] getPrefetchedData() {
                return this.prefetchData;
            }
    
            public final int getPrefetchedDataSize() {
                return this.prefetchDataSize;
            }
    
            public final void setActivePrefetch(boolean paramBoolean) {
                if ((this.activePrefetch) && (!(paramBoolean)))
                    clearCachedData();
                this.activePrefetch = paramBoolean;
            }
    
            public final void clearCachedData() {
                this.cachedLobLength = -1L;
                this.prefetchData = null;
            }
    
            public final boolean isActivePrefetch() {
                return this.activePrefetch;
            }
    
            boolean canReadBasicLobDataInLocator() throws SQLException {
                byte[] arrayOfByte = shareBytes();
                if ((arrayOfByte == null) || (arrayOfByte.length < 102)) {
                  return false;
                }
                if (!getPhysicalConnection().isDataInLocatorEnabled()) {
                  return false;
                }
                int i = arrayOfByte[6] & 0xFF;
                int j = arrayOfByte[7] & 0xFF;
                int k = (i & 0x8) == 8 ? 1 : 0;
                int m = (j & 0xFFFFFF80) == -128 ? 1 : 0;
                int n = 0;
                if ((k != 0) && (m == 0))
                {
                  n = ((arrayOfByte[88] & 0xFF) & 0x8) == 8 ? 1 : 0;
                }
                return (k != 0) && (m == 0) && (n != 0);
            }
    
            int dilLength() {
                return (shareBytes().length - 86 - 16);
            }
    
            byte[] dilGetBytes(long paramLong, int paramInt) throws SQLException {
                if (paramInt == 0) {
                    return new byte[0];
                }
    
                if (dilLength() == 0) {
                    return null;
                }
                int i = (int) Math.min(paramInt, dilLength() - (paramLong - 1L));
    
                if (i <= 0) {
                    return null;
                }
    
                byte[] arrayOfByte = new byte[i];
                System.arraycopy(shareBytes(), (int) (paramLong - 1L) + 86 + 16, arrayOfByte, 0, i);
                return arrayOfByte;
            }
    
            InputStream dilGetBinaryStream(long paramLong) throws SQLException {
                if (paramLong < 0L) {
                    throw new IllegalArgumentException("Illegal Arguments");
                }
    
                byte[] arrayOfByte = dilGetBytes(paramLong, dilLength());
    
                if (arrayOfByte == null) {
                    arrayOfByte = new byte[0];
                }
    
                return new ByteArrayInputStream(arrayOfByte);
            }
    
            public void free() throws SQLException {
                if (this.isFree)
                    return;
                if (isOpen())
                    close();
                if (isTemporary())
                    freeTemporary();
                this.isFree = true;
                this.dbaccess = null;
            }
    
            public InputStream getBinaryStream(long paramLong1, long paramLong2) throws SQLException {
                if (this.isFree) {
                    SQLException localSQLException1 = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            192);
                    localSQLException1.fillInStackTrace();
                    throw localSQLException1;
                }
                if (canReadBasicLobDataInLocator()) {
                    return dilGetBinaryStream(paramLong1, paramLong2);
                }
                long l = length();
                if ((paramLong1 < 1L) || (paramLong2 < 0L) || (paramLong1 > l) || (paramLong1 - 1L + paramLong2 > l)) {
                    SQLException localSQLException2 = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(),
                            68);
                    localSQLException2.fillInStackTrace();
                    throw localSQLException2;
                }
                return getDBAccess().newInputStream(this, getChunkSize(), paramLong1, paramLong2);
            }
    
            InputStream dilGetBinaryStream(long paramLong1, long paramLong2) throws SQLException {
                int i = dilLength();
                if ((paramLong1 < 1L) || (paramLong2 < 0L) || (paramLong1 > i) || (paramLong1 - 1L + paramLong2 > i)) {
                    localObject = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 68);
                    ((SQLException) localObject).fillInStackTrace();
                    throw ((SQLException) localObject);
                }
                byte[] localObject = dilGetBytes(paramLong1, i - (int) (paramLong1 - 1L));
                return ((InputStream) new ByteArrayInputStream(localObject, 0, (int) paramLong2));
            }
        }
    



    1. PHP-ページネーションを使用したMySQLクエリ

    2. INSERTトリガーの後にOracleからWindowsサービスを呼び出す

    3. 事前定義された値を持つ複数選択のRails4フィールドタイプ

    4. 複数のテーブルにわたるSQLの一意性制約