org.eclipse.datatools.connectivity.oda.consumer_3.2.5.v201109151100

16:42:42.432 INFO  jd.cli.Main - Decompiling org.eclipse.datatools.connectivity.oda.consumer_3.2.5.v201109151100.jar
package org.eclipse.datatools.connectivity.oda.consumer.helper;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.datatools.connectivity.oda.IBlob;
import org.eclipse.datatools.connectivity.oda.OdaException;

class BlobReader
  extends OdaObject
{
  private static final int DEFAULT_BUFFER_SIZE = 2048;
  private static final String COMMA_SEPARATOR = ", ";
  private static String sm_className = null;
  private IBlob m_odaBlob;
  private int m_defaultBufferSize;
  
  protected BlobReader(IBlob odaBlob)
  {
    init(odaBlob, 2048);
  }
  
  protected BlobReader(IBlob odaBlob, int defaultBufferSize)
  {
    init(odaBlob, defaultBufferSize);
  }
  
  private void init(IBlob odaBlob, int defaultBufferSize)
  {
    assert (odaBlob != null);
    m_odaBlob = odaBlob;
    m_defaultBufferSize = (defaultBufferSize >= 0 ? 
      defaultBufferSize : 2048);
    if (sm_className == null) {
      sm_className = getClassName();
    }
  }
  
  private int getDefaultBufferSize()
  {
    return m_defaultBufferSize;
  }
  
  byte[] getBytes(long startPos, int length)
    throws IOException, OdaException
  {
    String context = sm_className + ".getBytes( " + 
      startPos + ", " + length + " )\t";
    logMethodCalled(context);
    
    InputStream driverStream = null;
    try
    {
      driverStream = m_odaBlob.getBinaryStream();
    }
    catch (OdaException e1)
    {
      log(context, e1.toString());
    }
    if (driverStream == null)
    {
      logMethodExitWithReturn(context, null);
      return null;
    }
    BufferedInputStream bufferedStream = new BufferedInputStream(driverStream);
    
    long numToSkip = 0L;
    if (startPos > 1L)
    {
      numToSkip = startPos - 1L;
      long numSkipped = bufferedStream.skip(numToSkip);
      if (numSkipped != numToSkip)
      {
        bufferedStream.close();
        logMethodExitWithReturn(context, null);
        return null;
      }
    }
    int numToRead = length;
    
    long streamLen = getStreamLength();
    if (streamLen >= 0L)
    {
      int numAvailable = streamLen > numToSkip ? 
        new Long(streamLen - numToSkip).intValue() : 
        0;
      if ((length < 0) || (length > numAvailable)) {
        numToRead = numAvailable;
      }
    }
    if (numToRead >= 0)
    {
      byte[] bytesData = readBytesFromStream(bufferedStream, numToRead);
      bufferedStream.close();
      
      int arraySize = bytesData != null ? bytesData.length : -1;
      logMethodExitWithReturn(context, arraySize);
      return bytesData;
    }
    byte[] remainingBytes = (byte[])null;
    try
    {
      remainingBytes = readRemainingBytes(bufferedStream);
    }
    catch (OutOfMemoryError err)
    {
      err.printStackTrace();
    }
    bufferedStream.close();
    
    int arraySize = remainingBytes != null ? remainingBytes.length : -1;
    logMethodExitWithReturn(context, arraySize);
    
    return remainingBytes;
  }
  
  private byte[] readBytesFromStream(InputStream stream, int maxBufSize)
    throws IOException
  {
    String context = sm_className + ".readBytesFromStream( " + 
      stream + ", " + maxBufSize + " )\t";
    assert (maxBufSize >= 0);
    byte[] outBuffer = new byte[maxBufSize];
    if (maxBufSize == 0)
    {
      log(context, "Returns an empty byte array.");
      return outBuffer;
    }
    int bytesRead = stream.read(outBuffer, 0, outBuffer.length);
    if (bytesRead == maxBufSize)
    {
      log(context, "Returns a byte array of requested size: " + outBuffer.length);
      return outBuffer;
    }
    if (bytesRead < 0)
    {
      log(context, "Returns a null byte array for end of stream.");
      return null;
    }
    byte[] resizedBuf = new byte[bytesRead];
    System.arraycopy(outBuffer, 0, resizedBuf, 0, bytesRead);
    
    log(context, "Returns a byte array of size: " + resizedBuf.length);
    
    return resizedBuf;
  }
  
  private byte[] readRemainingBytes(InputStream stream)
    throws IOException
  {
    String context = sm_className + ".readRemainingBytes( " + stream + " )\t";
    
    ArrayList bufferList = new ArrayList();
    int bufferSize = getDefaultBufferSize();
    log(context, "Default buffer size: " + bufferSize);
    
    boolean endOfStream = false;
    byte[] aChunk = (byte[])null;
    while (!endOfStream)
    {
      aChunk = readBytesFromStream(stream, bufferSize);
      if (aChunk != null) {
        bufferList.add(aChunk);
      }
      endOfStream = (aChunk == null) || (aChunk.length < bufferSize) || 
        (bufferSize == 0);
    }
    if (bufferList.isEmpty())
    {
      log(context, "Returns an empty byte array.");
      return new byte[0];
    }
    int totalBytes = 0;
    Iterator bufferIter = bufferList.iterator();
    while (bufferIter.hasNext())
    {
      aChunk = (byte[])bufferIter.next();
      assert (aChunk != null);
      totalBytes += aChunk.length;
    }
    if (totalBytes <= 0)
    {
      log(context, "Returns an empty byte array.");
      return new byte[0];
    }
    byte[] remainingBytes = new byte[totalBytes];
    bufferIter = bufferList.iterator();
    int bytesCopied = 0;
    while (bufferIter.hasNext())
    {
      aChunk = (byte[])bufferIter.next();
      
      System.arraycopy(aChunk, 0, remainingBytes, bytesCopied, aChunk.length);
      bytesCopied += aChunk.length;
      assert (bytesCopied <= totalBytes);
    }
    log(context, "Returns a byte array of size: " + remainingBytes.length);
    return remainingBytes;
  }
  
  private long getStreamLength()
  {
    long len = -1L;
    try
    {
      len = m_odaBlob.length();
    }
    catch (OdaException localOdaException) {}catch (UnsupportedOperationException localUnsupportedOperationException) {}catch (RuntimeException localRuntimeException) {}
    return len;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.oda.consumer.helper.BlobReader
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity.oda.consumer.helper;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.datatools.connectivity.oda.IClob;
import org.eclipse.datatools.connectivity.oda.OdaException;

class ClobReader
  extends OdaObject
{
  private static final int DEFAULT_BUFFER_SIZE = 2048;
  private static final String EMPTY_STR = "";
  private static final String COMMA_SEPARATOR = ", ";
  private static String sm_className = null;
  private IClob m_odaClob;
  private int m_defaultBufferSize;
  
  protected ClobReader(IClob odaClob)
  {
    init(odaClob, 2048);
  }
  
  protected ClobReader(IClob odaClob, int defaultBufferSize)
  {
    init(odaClob, defaultBufferSize);
  }
  
  private void init(IClob odaClob, int defaultBufferSize)
  {
    assert (odaClob != null);
    m_odaClob = odaClob;
    m_defaultBufferSize = (defaultBufferSize >= 0 ? 
      defaultBufferSize : 2048);
    if (sm_className == null) {
      sm_className = getClassName();
    }
  }
  
  private int getDefaultBufferSize()
  {
    return m_defaultBufferSize;
  }
  
  String getSubString(long startPos, int length)
    throws IOException, OdaException
  {
    String context = sm_className + ".getSubString( " + 
      startPos + ", " + length + " )\t";
    logMethodCalled(context);
    
    Reader driverReader = null;
    try
    {
      driverReader = m_odaClob.getCharacterStream();
    }
    catch (OdaException e1)
    {
      log(context, e1.toString());
    }
    if (driverReader == null)
    {
      logMethodExitWithReturn(context, null);
      return null;
    }
    BufferedReader bufferedStream = new BufferedReader(driverReader);
    
    long numToSkip = 0L;
    if (startPos > 1L)
    {
      numToSkip = startPos - 1L;
      long numSkipped = bufferedStream.skip(numToSkip);
      if (numSkipped != numToSkip)
      {
        bufferedStream.close();
        logMethodExitWithReturn(context, null);
        return null;
      }
    }
    int numToRead = length;
    
    long streamLen = getStreamLength();
    if (streamLen >= 0L)
    {
      int numAvailable = streamLen > numToSkip ? 
        new Long(streamLen - numToSkip).intValue() : 
        0;
      if ((length < 0) || (length > numAvailable)) {
        numToRead = numAvailable;
      }
    }
    if (numToRead >= 0)
    {
      char[] readData = readCharsFromStream(bufferedStream, numToRead);
      bufferedStream.close();
      String readString = new String(readData);
      
      logMethodExitWithReturnLen(context, readString);
      return readString;
    }
    String remainingStream = null;
    try
    {
      remainingStream = readRemainingString(bufferedStream);
    }
    catch (OutOfMemoryError err)
    {
      err.printStackTrace();
    }
    bufferedStream.close();
    
    logMethodExitWithReturnLen(context, remainingStream);
    return remainingStream;
  }
  
  private char[] readCharsFromStream(Reader stream, int maxBufSize)
    throws IOException
  {
    String context = sm_className + ".readCharsFromStream( " + 
      stream + ", " + maxBufSize + " )\t";
    assert (maxBufSize >= 0);
    char[] outBuffer = new char[maxBufSize];
    if (maxBufSize == 0)
    {
      log(context, "Returns an empty char array.");
      return outBuffer;
    }
    int numRead = stream.read(outBuffer, 0, outBuffer.length);
    if (numRead == maxBufSize)
    {
      log(context, "Returns a char array of requested size: " + outBuffer.length);
      return outBuffer;
    }
    if (numRead < 0)
    {
      log(context, "Returns a null char array for end of stream.");
      return null;
    }
    char[] resizedBuf = new char[numRead];
    System.arraycopy(outBuffer, 0, resizedBuf, 0, numRead);
    
    log(context, "Returns a char array of size: " + resizedBuf.length);
    
    return resizedBuf;
  }
  
  private String readRemainingString(Reader stream)
    throws IOException
  {
    String context = sm_className + ".readRemainingString( " + stream + " )\t";
    
    ArrayList bufferList = new ArrayList();
    int bufferSize = getDefaultBufferSize();
    log(context, "Default buffer size: " + bufferSize);
    
    boolean endOfStream = false;
    char[] aChunk = (char[])null;
    while (!endOfStream)
    {
      aChunk = readCharsFromStream(stream, bufferSize);
      if (aChunk != null) {
        bufferList.add(aChunk);
      }
      endOfStream = (aChunk == null) || (aChunk.length < bufferSize) || 
        (bufferSize == 0);
    }
    if (bufferList.isEmpty())
    {
      log(context, "Returns an empty String.");
      return "";
    }
    int totalChars = 0;
    Iterator bufferIter = bufferList.iterator();
    while (bufferIter.hasNext())
    {
      aChunk = (char[])bufferIter.next();
      assert (aChunk != null);
      totalChars += aChunk.length;
    }
    if (totalChars <= 0)
    {
      log(context, "Returns an empty String.");
      return "";
    }
    StringBuffer remainingString = new StringBuffer(totalChars);
    bufferIter = bufferList.iterator();
    while (bufferIter.hasNext())
    {
      aChunk = (char[])bufferIter.next();
      
      remainingString = remainingString.append(aChunk);
    }
    log(context, "Returns a String of size: " + remainingString.length());
    return remainingString.toString();
  }
  
  private long getStreamLength()
  {
    long len = -1L;
    try
    {
      len = m_odaClob.length();
    }
    catch (OdaException localOdaException) {}catch (UnsupportedOperationException localUnsupportedOperationException) {}catch (RuntimeException localRuntimeException) {}
    return len;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.oda.consumer.helper.ClobReader
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity.oda.consumer.helper;

import com.ibm.icu.util.ULocale;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import org.eclipse.datatools.connectivity.oda.OdaException;
import org.eclipse.datatools.connectivity.oda.consumer.services.IPropertyProvider;
import org.eclipse.datatools.connectivity.oda.consumer.services.impl.ProviderUtil;

class ConnectionPropertyHandler
  extends OdaObject
{
  private String m_consumerApplId;
  private Object m_connPropContext;
  private IPropertyProvider m_propertyProvider;
  private ULocale m_appLocale;
  
  ConnectionPropertyHandler(Object context)
  {
    processConsumerAppContext(context);
  }
  
  protected String getConsumerApplicationId()
  {
    return m_consumerApplId;
  }
  
  protected Object getConnectionPropertyContext()
  {
    return m_connPropContext;
  }
  
  protected ULocale getAppLocale()
  {
    return m_appLocale;
  }
  
  private void processConsumerAppContext(Object context)
  {
    logMethodCalled("ConnectionPropertyHandler.processConsumerAppContext");
    
    m_consumerApplId = ProviderUtil.getConsumerApplicationId(context);
    log("ConnectionPropertyHandler.processConsumerAppContext", "Consumer Application ID: " + m_consumerApplId);
    
    m_connPropContext = ProviderUtil.getConnectionPropertyContext(context);
    log("ConnectionPropertyHandler.processConsumerAppContext", "Externalized property context: " + m_connPropContext);
    
    m_appLocale = getAppLocale(context);
    log("ConnectionPropertyHandler.processConsumerAppContext", "Application Locale in context: " + m_appLocale);
    
    logMethodExit("ConnectionPropertyHandler.processConsumerAppContext");
  }
  
  protected Properties getEffectiveProperties(Properties candidateProperties)
    throws OdaException
  {
    String methodName = "ConnectionPropertyHandler.getEffectiveProperties( " + 
      candidateProperties + " )\t";
    logMethodCalled(methodName);
    
    IPropertyProvider propProvider = getExtensionPropertyProvider();
    if (propProvider == null)
    {
      logMethodExit(methodName);
      return candidateProperties;
    }
    Properties effectiveProps = 
      propProvider.getDataSourceProperties(candidateProperties, 
      getConnectionPropertyContext());
    
    log(methodName, "Effective properties: " + effectiveProps);
    logMethodExit(methodName);
    
    return effectiveProps;
  }
  
  private IPropertyProvider getExtensionPropertyProvider()
    throws OdaException
  {
    if (m_propertyProvider == null)
    {
      String applicationId = getConsumerApplicationId();
      m_propertyProvider = ProviderUtil.createPropertyProvider(applicationId);
    }
    return m_propertyProvider;
  }
  
  private ULocale getAppLocale(Object appContext)
  {
    if ((appContext == null) || (!(appContext instanceof Map))) {
      return null;
    }
    String localeKey = "AppRuntimeLocale";
    Object localeValue = ((Map)appContext).get(localeKey);
    if (localeValue == null) {
      return null;
    }
    if ((localeValue instanceof Locale)) {
      return ULocale.forLocale((Locale)localeValue);
    }
    if ((localeValue instanceof ULocale)) {
      return (ULocale)localeValue;
    }
    if ((localeValue instanceof String))
    {
      String localeString = (String)localeValue;
      return new ULocale(localeString);
    }
    logWarning("getAppLocale(Object)", 
      "Ignoring invalid object type (" + localeValue.getClass().getName() + 
      ") specified for the application locale key " + localeKey);
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.oda.consumer.helper.ConnectionPropertyHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity.oda.consumer.helper;

import org.eclipse.core.runtime.Platform;
import org.eclipse.datatools.connectivity.oda.OdaException;
import org.eclipse.datatools.connectivity.oda.consumer.util.manifest.DriverExtensionManifest;
import org.eclipse.datatools.connectivity.oda.consumer.util.manifest.ExtensionExplorer;
import org.eclipse.datatools.connectivity.oda.util.manifest.ExtensionManifest;
import org.eclipse.datatools.connectivity.oda.util.manifest.JavaRuntimeInterface;
import org.eclipse.datatools.connectivity.oda.util.manifest.ManifestExplorer;
import org.eclipse.datatools.connectivity.oda.util.manifest.RuntimeInterface;
import org.osgi.framework.Bundle;

public class DriverExtensionHelper
{
  public static String getEffectiveDataSourceId(String odaDataSourceId)
    throws OdaException
  {
    if (odaDataSourceId == null) {
      return null;
    }
    try
    {
      odaDataSourceManifest = ManifestExplorer.getInstance().getExtensionManifest(odaDataSourceId);
    }
    catch (IllegalArgumentException ex)
    {
      ExtensionManifest odaDataSourceManifest;
      throw new OdaException(ex);
    }
    ExtensionManifest odaDataSourceManifest;
    Class driverClass = loadDriverClass(odaDataSourceManifest);
    
    String bridgeDataSourceId = getDriverBridgeId(driverClass);
    if ((bridgeDataSourceId == null) || 
      (bridgeDataSourceId.equalsIgnoreCase(odaDataSourceId))) {
      return odaDataSourceId;
    }
    return getEffectiveDataSourceId(bridgeDataSourceId);
  }
  
  static String getDriverBridgeId(Class odaDriverClass)
  {
    if (odaDriverClass == null) {
      throw new IllegalArgumentException();
    }
    String bridgeDataSourceId = getDriverBridgeId(odaDriverClass.getName());
    if (bridgeDataSourceId != null) {
      return bridgeDataSourceId;
    }
    Class[] driverTypes = odaDriverClass.getInterfaces();
    for (int i = 0; i < driverTypes.length; i++)
    {
      bridgeDataSourceId = getDriverBridgeId(driverTypes[i].getName());
      if (bridgeDataSourceId != null) {
        return bridgeDataSourceId;
      }
    }
    return null;
  }
  
  private static String getDriverBridgeId(String driverType)
  {
    DriverExtensionManifest manifest = null;
    try
    {
      manifest = 
        ExtensionExplorer.getInstance().getDriverExtensionManifest(driverType);
    }
    catch (OdaException localOdaException) {}
    return manifest != null ? manifest.getBridgeDataSourceId() : null;
  }
  
  static Class loadDriverClass(ExtensionManifest driverConfig)
    throws OdaException
  {
    String driverClassName = getRuntimeInterface(driverConfig).getDriverClass();
    
    Bundle bundle = Platform.getBundle(driverConfig.getNamespace());
    try
    {
      return bundle != null ? 
        bundle.loadClass(driverClassName) : 
        Class.forName(driverClassName);
    }
    catch (ClassNotFoundException ex)
    {
      throw new OdaException(ex);
    }
  }
  
  static JavaRuntimeInterface getRuntimeInterface(ExtensionManifest driverConfig)
  {
    if (driverConfig == null) {
      throw new IllegalArgumentException();
    }
    RuntimeInterface runtime = driverConfig.getRuntimeInterface();
    assert ((runtime instanceof JavaRuntimeInterface));
    return (JavaRuntimeInterface)runtime;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.oda.consumer.helper.DriverExtensionHelper
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity.oda.consumer.helper;

import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import org.eclipse.datatools.connectivity.oda.IAdvancedQuery;
import org.eclipse.datatools.connectivity.oda.IBlob;
import org.eclipse.datatools.connectivity.oda.IClob;
import org.eclipse.datatools.connectivity.oda.IParameterRowSet;
import org.eclipse.datatools.connectivity.oda.IQuery;
import org.eclipse.datatools.connectivity.oda.IResultSet;
import org.eclipse.datatools.connectivity.oda.IResultSetMetaData;
import org.eclipse.datatools.connectivity.oda.OdaException;
import org.eclipse.datatools.connectivity.oda.SortSpec;
import org.eclipse.datatools.connectivity.oda.consumer.nls.Messages;

public class OdaAdvancedQuery
  extends OdaQuery
  implements IAdvancedQuery
{
  private static final String MSG_ARG_SEPARATOR = ", ";
  private static final String MSG_LINE_SEPARATOR = " )\t";
  private boolean m_calledExecuteQueryForExecute = false;
  private IResultSet m_resultSet;
  
  protected OdaAdvancedQuery(IAdvancedQuery statement, OdaConnection connection, String dataSetType, boolean switchContextClassloader, ClassLoader driverClassLoader)
  {
    super(statement, connection, dataSetType, switchContextClassloader, driverClassLoader);
    
    String context = "OdaAdvancedQuery.OdaAdvancedQuery( " + 
      statement + ", " + connection + ", " + 
      dataSetType + " )\t";
    logMethodExitWithReturn(context, this);
  }
  
  private IAdvancedQuery getAdvancedQuery()
  {
    return (IAdvancedQuery)getQuery();
  }
  
  public boolean execute()
    throws OdaException
  {
    logMethodCalled("OdaAdvancedQuery.execute()\t");
    try
    {
      setContextClassloader();
      
      doExecute();
      logMethodExitWithReturn("OdaAdvancedQuery.execute()\t", isExecuted());
      return isExecuted();
    }
    catch (UnsupportedOperationException uoException)
    {
      return handleUnsupportedOpAndRetFalse(uoException, 
        "IAdvancedQuery.execute()");
    }
    catch (RuntimeException rtException)
    {
      return handleErrorAndReturnFalse(rtException);
    }
    catch (OdaException odaException)
    {
      boolean bool;
      return handleErrorAndReturnFalse(odaException);
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  private boolean doExecute()
    throws OdaException
  {
    resetExecuteStates();
    if (!isPreparedSuccessfully()) {
      throw newOdaException(Messages.helper_cannotExecuteBeforePrepare);
    }
    boolean supportsMultipleResultSets = 
      getDSMetaData().checkSupportForMultipleResultSets();
    boolean supportsNamedResultSets = 
      getDSMetaData().checkSupportForNamedResultSets();
    
    boolean isExecuted = false;
    if ((supportsMultipleResultSets) || (supportsNamedResultSets))
    {
      setIsExecuting(true);
      isExecuted = getAdvancedQuery().execute();
    }
    else
    {
      setIsExecuting(true);
      m_resultSet = getQuery().executeQuery();
      
      m_calledExecuteQueryForExecute = true;
      isExecuted = true;
    }
    setIsExecuting(false);
    setIsExecuted(isExecuted);
    
    return isExecuted;
  }
  
  private boolean wasExecuteQueryCalledForExec()
  {
    return m_calledExecuteQueryForExecute;
  }
  
  protected void resetExecuteStates()
  {
    super.resetExecuteStates();
    m_calledExecuteQueryForExecute = false;
    m_resultSet = null;
  }
  
  public IResultSet getResultSet()
    throws OdaException
  {
    logMethodCalled("OdaAdvancedQuery.getResultSet()\t");
    try
    {
      setContextClassloader();
      
      OdaResultSet ret = null;
      if (m_calledExecuteQueryForExecute)
      {
        ret = m_resultSet == null ? null : newResultSetHelper(m_resultSet);
        
        m_resultSet = null;
      }
      else
      {
        IResultSet resultSet = getAdvancedQuery().getResultSet();
        
        ret = resultSet == null ? null : newResultSetHelper(resultSet);
      }
      logMethodExitWithReturn("OdaAdvancedQuery.getResultSet()\t", ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      handleUnsupportedOp(uoException, 
        "IAdvancedQuery.getResultSet()");
      return null;
    }
    catch (RuntimeException rtException)
    {
      handleError(rtException);
      return null;
    }
    catch (OdaException odaException)
    {
      handleError(odaException);
      return null;
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public boolean getMoreResults()
    throws OdaException
  {
    logMethodCalled("OdaAdvancedQuery.getMoreResults()\t");
    try
    {
      setContextClassloader();
      
      boolean ret = m_calledExecuteQueryForExecute ? false : 
        getAdvancedQuery().getMoreResults();
      
      logMethodExitWithReturn("OdaAdvancedQuery.getMoreResults()\t", ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      return handleUnsupportedOpAndRetFalse(uoException, 
        "IAdvancedQuery.getMoreResults()");
    }
    catch (RuntimeException rtException)
    {
      return handleErrorAndReturnFalse(rtException);
    }
    catch (OdaException odaException)
    {
      boolean bool1;
      return handleErrorAndReturnFalse(odaException);
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public IResultSetMetaData getMetaDataOf(String resultSetName)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.getMetaDataOf( " + 
      resultSetName + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      
      IResultSetMetaData resultSetMetaData = 
        getAdvancedQuery().getMetaDataOf(resultSetName);
      
      OdaResultSetMetaData ret = 
        resultSetMetaData == null ? null : 
        new OdaResultSetMetaData(resultSetMetaData, getOdaConnection(), 
        switchContextClassloader(), 
        getDriverClassLoader());
      
      logMethodExitWithReturn(context, ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      handleUnsupportedOp(uoException, 
        "IAdvancedQuery.getMetaDataOf( String resultSetName )");
      return null;
    }
    catch (RuntimeException rtException)
    {
      handleError(rtException);
      return null;
    }
    catch (OdaException odaException)
    {
      handleError(odaException);
      return null;
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public String[] getResultSetNames()
    throws OdaException
  {
    logMethodCalled("OdaAdvancedQuery.getResultSetNames()\t");
    try
    {
      setContextClassloader();
      
      String[] ret = getAdvancedQuery().getResultSetNames();
      
      logMethodExitWithReturn("OdaAdvancedQuery.getResultSetNames()\t", ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      handleUnsupportedOp(uoException, 
        "IAdvancedQuery.getResultSetNames()");
      return null;
    }
    catch (RuntimeException rtException)
    {
      handleError(rtException);
      return null;
    }
    catch (OdaException odaException)
    {
      handleError(odaException);
      return null;
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public IResultSet getResultSet(String resultSetName)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.getResultSet( " + 
      resultSetName + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      if (wasExecuteQueryCalledForExec()) {
        throw newOdaException(Messages.helper_cannotGetNamedResultsAfterExecuteQuery);
      }
      IResultSet resultSet = getAdvancedQuery().getResultSet(resultSetName);
      
      OdaResultSet ret = null;
      if (resultSet == null) {
        ret = null;
      } else {
        ret = newResultSetHelper(resultSet);
      }
      logMethodExitWithReturn(context, ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      handleUnsupportedOp(uoException, 
        "IAdvancedQuery.getResultSet( String resultSetName )");
      return null;
    }
    catch (RuntimeException rtException)
    {
      handleError(rtException);
      return null;
    }
    catch (OdaException odaException)
    {
      handleError(odaException);
      return null;
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public IParameterRowSet setNewRow(String parameterName)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.setNewRow( " + parameterName + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      throwIfSetParamBeforePrepare();
      
      IParameterRowSet rowSet = getAdvancedQuery().setNewRow(parameterName);
      OdaRowSet ret = createFactoryRow(rowSet);
      
      logMethodExitWithReturn(context, ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      handleUnsupportedOp(uoException, 
        "IAdvancedQuery.setNewRow( String parameterName )");
      return null;
    }
    catch (RuntimeException rtException)
    {
      handleError(rtException);
      return null;
    }
    catch (OdaException odaException)
    {
      handleError(odaException);
      return null;
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public IParameterRowSet setNewRow(int parameterId)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.setNewRow( " + parameterId + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      throwIfSetParamBeforePrepare();
      
      IParameterRowSet rowSet = getAdvancedQuery().setNewRow(parameterId);
      OdaRowSet ret = createFactoryRow(rowSet);
      
      logMethodExitWithReturn(context, ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      handleUnsupportedOp(uoException, 
        "IAdvancedQuery.setNewRow( int parameterId )");
      return null;
    }
    catch (RuntimeException rtException)
    {
      handleError(rtException);
      return null;
    }
    catch (OdaException odaException)
    {
      handleError(odaException);
      return null;
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public IParameterRowSet setNewRowSet(String parameterName)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.setNewRowSet( " + parameterName + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      throwIfSetParamBeforePrepare();
      
      IParameterRowSet rowSet = getAdvancedQuery().setNewRowSet(parameterName);
      
      OdaRowSet ret = 
        rowSet == null ? null : 
        new OdaRowSet(rowSet, getOdaConnection(), 
        switchContextClassloader(), 
        getDriverClassLoader());
      
      logMethodExitWithReturn(context, ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      handleUnsupportedOp(uoException, 
        "IAdvancedQuery.setNewRowSet( String parameterName )");
      return null;
    }
    catch (RuntimeException rtException)
    {
      handleError(rtException);
      return null;
    }
    catch (OdaException odaException)
    {
      handleError(odaException);
      return null;
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public IParameterRowSet setNewRowSet(int parameterId)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.setNewRowSet( " + parameterId + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      throwIfSetParamBeforePrepare();
      
      IParameterRowSet rowSet = getAdvancedQuery().setNewRowSet(parameterId);
      
      OdaRowSet ret = 
        rowSet == null ? null : 
        new OdaRowSet(rowSet, getOdaConnection(), 
        switchContextClassloader(), 
        getDriverClassLoader());
      
      logMethodExitWithReturn(context, ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      handleUnsupportedOp(uoException, 
        "IAdvancedQuery.setNewRowSet( int parameterId )");
      return null;
    }
    catch (RuntimeException rtException)
    {
      handleError(rtException);
      return null;
    }
    catch (OdaException odaException)
    {
      handleError(odaException);
      return null;
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public int getInt(String parameterName)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.getInt( " + parameterName + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      throwIfNotExecuted();
      
      int ret = 0;
      if (getDSMetaData().checkSupportForNamedParameters())
      {
        ret = getAdvancedQuery().getInt(parameterName);
      }
      else
      {
        int index = getAdvancedQuery().findOutParameter(parameterName);
        ret = getAdvancedQuery().getInt(index);
      }
      logMethodExitWithReturn(context, ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      return handleUnsupportedOpAndRetZero(uoException, 
        "IAdvancedQuery.getInt( String parameterName )");
    }
    catch (RuntimeException rtException)
    {
      return handleErrorAndReturnZero(rtException);
    }
    catch (OdaException odaException)
    {
      int i;
      return handleErrorAndReturnZero(odaException);
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public int getInt(int parameterId)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.getInt( " + parameterId + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      throwIfNotExecuted();
      
      int ret = getAdvancedQuery().getInt(parameterId);
      
      logMethodExitWithReturn(context, ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      return handleUnsupportedOpAndRetZero(uoException, 
        "IAdvancedQuery.getInt( int parameterId )");
    }
    catch (RuntimeException rtException)
    {
      return handleErrorAndReturnZero(rtException);
    }
    catch (OdaException odaException)
    {
      int i;
      return handleErrorAndReturnZero(odaException);
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public double getDouble(String parameterName)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.getDouble( " + parameterName + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      throwIfNotExecuted();
      
      double ret = 0.0D;
      if (getDSMetaData().checkSupportForNamedParameters())
      {
        ret = getAdvancedQuery().getDouble(parameterName);
      }
      else
      {
        int index = getAdvancedQuery().findOutParameter(parameterName);
        ret = getAdvancedQuery().getDouble(index);
      }
      logMethodExitWithReturn(context, ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      return handleUnsupportedOpAndRetZero(uoException, 
        "IAdvancedQuery.getDouble( String parameterName )");
    }
    catch (RuntimeException rtException)
    {
      return handleErrorAndReturnZero(rtException);
    }
    catch (OdaException odaException)
    {
      double d1;
      return handleErrorAndReturnZero(odaException);
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public double getDouble(int parameterId)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.getDouble( " + parameterId + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      throwIfNotExecuted();
      
      double ret = getAdvancedQuery().getDouble(parameterId);
      
      logMethodExitWithReturn(context, ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      return handleUnsupportedOpAndRetZero(uoException, 
        "IAdvancedQuery.getDouble( int parameterId )");
    }
    catch (RuntimeException rtException)
    {
      return handleErrorAndReturnZero(rtException);
    }
    catch (OdaException odaException)
    {
      double d1;
      return handleErrorAndReturnZero(odaException);
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public BigDecimal getBigDecimal(String parameterName)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.getBigDecimal( " + parameterName + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      throwIfNotExecuted();
      
      BigDecimal ret = null;
      if (getDSMetaData().checkSupportForNamedParameters())
      {
        ret = getAdvancedQuery().getBigDecimal(parameterName);
      }
      else
      {
        int index = getAdvancedQuery().findOutParameter(parameterName);
        ret = getAdvancedQuery().getBigDecimal(index);
      }
      logMethodExitWithReturn(context, ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      handleUnsupportedOp(uoException, 
        "IAdvancedQuery.getBigDecimal( String parameterName )");
    }
    catch (RuntimeException rtException)
    {
      handleError(rtException);
    }
    catch (OdaException odaException)
    {
      handleError(odaException);
    }
    finally
    {
      resetContextClassloader();
    }
    return null;
  }
  
  public BigDecimal getBigDecimal(int parameterId)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.getBigDecimal( " + parameterId + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      throwIfNotExecuted();
      
      BigDecimal ret = getAdvancedQuery().getBigDecimal(parameterId);
      
      logMethodExitWithReturn(context, ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      handleUnsupportedOp(uoException, 
        "IAdvancedQuery.getBigDecimal( int parameterId )");
    }
    catch (RuntimeException rtException)
    {
      handleError(rtException);
    }
    catch (OdaException odaException)
    {
      handleError(odaException);
    }
    finally
    {
      resetContextClassloader();
    }
    return null;
  }
  
  public String getString(String parameterName)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.getString( " + parameterName + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      throwIfNotExecuted();
      
      String ret = null;
      if (getDSMetaData().checkSupportForNamedParameters())
      {
        ret = getAdvancedQuery().getString(parameterName);
      }
      else
      {
        int index = getAdvancedQuery().findOutParameter(parameterName);
        ret = getAdvancedQuery().getString(index);
      }
      logMethodExitWithReturn(context, ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      return handleUnsupportedOpAndRetEmptyString(uoException, 
        "IAdvancedQuery.getString( String parameterName )");
    }
    catch (RuntimeException rtException)
    {
      return handleErrorAndReturnEmptyString(rtException);
    }
    catch (OdaException odaException)
    {
      String str1;
      return handleErrorAndReturnEmptyString(odaException);
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public String getString(int parameterId)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.getString( " + parameterId + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      throwIfNotExecuted();
      
      String ret = getAdvancedQuery().getString(parameterId);
      
      logMethodExitWithReturn(context, ret);
      return ret;
    }
    catch (UnsupportedOperationException uoException)
    {
      return handleUnsupportedOpAndRetEmptyString(uoException, 
        "IAdvancedQuery.getString( int parameterId )");
    }
    catch (RuntimeException rtException)
    {
      return handleErrorAndReturnEmptyString(rtException);
    }
    catch (OdaException odaException)
    {
      String str1;
      return handleErrorAndReturnEmptyString(odaException);
    }
    finally
    {
      resetContextClassloader();
    }
  }
  
  public Date getDate(String parameterName)
    throws OdaException
  {
    String context = "OdaAdvancedQuery.getDate( " + parameterName + " )\t";
    logMethodCalled(context);
    try
    {
      setContextClassloader();
      throwIfNotExecuted();
      
      Date ret = null;
      if (getDSMetaData().checkSupportForNamedParameters())
      {
        ret = getAdvancedQuery().getDate(parameterName);
      }
      else
      {
        int index = getAdvan
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd