derby

16:35:08.502 INFO  jd.cli.Main - Decompiling derby.jar
package org.apache.derby.authentication;

import java.io.Serializable;
import java.security.Principal;

public final class SystemPrincipal
  implements Principal, Serializable
{
  static final long serialVersionUID = 925380094921530190L;
  private final String name;
  
  public SystemPrincipal(String paramString)
  {
    if (paramString == null) {
      throw new NullPointerException("name can't be null");
    }
    if (paramString.length() == 0) {
      throw new IllegalArgumentException("name can't be empty");
    }
    name = paramString;
  }
  
  public boolean equals(Object paramObject)
  {
    if (paramObject == null) {
      return false;
    }
    if (!(paramObject instanceof SystemPrincipal)) {
      return false;
    }
    SystemPrincipal localSystemPrincipal = (SystemPrincipal)paramObject;
    return name.equals(name);
  }
  
  public String getName()
  {
    return name;
  }
  
  public int hashCode()
  {
    return name.hashCode();
  }
  
  public String toString()
  {
    return getClass().getName() + "(" + name + ")";
  }
}

/* Location:
 * Qualified Name:     org.apache.derby.authentication.SystemPrincipal
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.derby.authentication;

import java.sql.SQLException;
import java.util.Properties;

public abstract interface UserAuthenticator
{
  public abstract boolean authenticateUser(String paramString1, String paramString2, String paramString3, Properties paramProperties)
    throws SQLException;
}

/* Location:
 * Qualified Name:     org.apache.derby.authentication.UserAuthenticator
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.derby.catalog;

public abstract interface AliasInfo
{
  public static final char ALIAS_TYPE_UDT_AS_CHAR = 'A';
  public static final char ALIAS_TYPE_PROCEDURE_AS_CHAR = 'P';
  public static final char ALIAS_TYPE_FUNCTION_AS_CHAR = 'F';
  public static final char ALIAS_TYPE_SYNONYM_AS_CHAR = 'S';
  public static final String ALIAS_TYPE_UDT_AS_STRING = "A";
  public static final String ALIAS_TYPE_PROCEDURE_AS_STRING = "P";
  public static final String ALIAS_TYPE_FUNCTION_AS_STRING = "F";
  public static final String ALIAS_TYPE_SYNONYM_AS_STRING = "S";
  public static final char ALIAS_NAME_SPACE_UDT_AS_CHAR = 'A';
  public static final char ALIAS_NAME_SPACE_PROCEDURE_AS_CHAR = 'P';
  public static final char ALIAS_NAME_SPACE_FUNCTION_AS_CHAR = 'F';
  public static final char ALIAS_NAME_SPACE_SYNONYM_AS_CHAR = 'S';
  public static final String ALIAS_NAME_SPACE_UDT_AS_STRING = "A";
  public static final String ALIAS_NAME_SPACE_PROCEDURE_AS_STRING = "P";
  public static final String ALIAS_NAME_SPACE_FUNCTION_AS_STRING = "F";
  public static final String ALIAS_NAME_SPACE_SYNONYM_AS_STRING = "S";
  
  public abstract String getMethodName();
  
  public abstract boolean isTableFunction();
}

/* Location:
 * Qualified Name:     org.apache.derby.catalog.AliasInfo
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.derby.catalog;

public abstract interface DefaultInfo
{
  public abstract String getDefaultText();
  
  public abstract String[] getReferencedColumnNames();
  
  public abstract boolean isDefaultValueAutoinc();
  
  public abstract boolean isGeneratedColumn();
  
  public abstract String getOriginalCurrentSchema();
}

/* Location:
 * Qualified Name:     org.apache.derby.catalog.DefaultInfo
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.derby.catalog;

public abstract interface Dependable
{
  public static final String ALIAS = "Alias";
  public static final String CONGLOMERATE = "Conglomerate";
  public static final String CONSTRAINT = "Constraint";
  public static final String DEFAULT = "Default";
  public static final String HEAP = "Heap";
  public static final String INDEX = "Index";
  public static final String PREPARED_STATEMENT = "PreparedStatement";
  public static final String ACTIVATION = "Activation";
  public static final String FILE = "File";
  public static final String STORED_PREPARED_STATEMENT = "StoredPreparedStatement";
  public static final String TABLE = "Table";
  public static final String COLUMNS_IN_TABLE = "ColumnsInTable";
  public static final String TRIGGER = "Trigger";
  public static final String VIEW = "View";
  public static final String SCHEMA = "Schema";
  public static final String TABLE_PERMISSION = "TablePrivilege";
  public static final String COLUMNS_PERMISSION = "ColumnsPrivilege";
  public static final String ROUTINE_PERMISSION = "RoutinePrivilege";
  public static final String ROLE_GRANT = "RoleGrant";
  public static final String SEQUENCE = "Sequence";
  public static final String PERM = "Perm";
  
  public abstract DependableFinder getDependableFinder();
  
  public abstract String getObjectName();
  
  public abstract UUID getObjectID();
  
  public abstract boolean isPersistent();
  
  public abstract String getClassType();
}

/* Location:
 * Qualified Name:     org.apache.derby.catalog.Dependable
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.derby.catalog;

import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.sql.dictionary.DataDictionary;

public abstract interface DependableFinder
{
  public abstract Dependable getDependable(DataDictionary paramDataDictionary, UUID paramUUID)
    throws StandardException;
  
  public abstract String getSQLObjectType();
}

/* Location:
 * Qualified Name:     org.apache.derby.catalog.DependableFinder
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.derby.catalog;

import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import org.apache.derby.catalog.types.RoutineAliasInfo;
import org.apache.derby.iapi.sql.ResultColumnDescriptor;
import org.apache.derby.iapi.types.DataTypeDescriptor;
import org.apache.derby.iapi.types.DataTypeUtilities;
import org.apache.derby.impl.jdbc.EmbedResultSetMetaData;
import org.apache.derby.vti.VTITemplate;

public class GetProcedureColumns
  extends VTITemplate
{
  private boolean isProcedure;
  private boolean isFunction;
  private int rowCount;
  private int returnedTableColumnCount;
  private TypeDescriptor tableFunctionReturnType;
  private RoutineAliasInfo procedure;
  private int paramCursor;
  private short method_count;
  private short param_number;
  private TypeDescriptor sqlType;
  private String columnName;
  private short columnType;
  private final short nullable;
  private static final ResultColumnDescriptor[] columnInfo = { EmbedResultSetMetaData.getResultColumnDescriptor("COLUMN_NAME", 12, false, 128), EmbedResultSetMetaData.getResultColumnDescriptor("COLUMN_TYPE", 5, false), EmbedResultSetMetaData.getResultColumnDescriptor("DATA_TYPE", 4, false), EmbedResultSetMetaData.getResultColumnDescriptor("TYPE_NAME", 12, false, 22), EmbedResultSetMetaData.getResultColumnDescriptor("PRECISION", 4, false), EmbedResultSetMetaData.getResultColumnDescriptor("LENGTH", 4, false), EmbedResultSetMetaData.getResultColumnDescriptor("SCALE", 5, false), EmbedResultSetMetaData.getResultColumnDescriptor("RADIX", 5, false), EmbedResultSetMetaData.getResultColumnDescriptor("NULLABLE", 5, false), EmbedResultSetMetaData.getResultColumnDescriptor("REMARKS", 12, true, 22), EmbedResultSetMetaData.getResultColumnDescriptor("METHOD_ID", 5, false), EmbedResultSetMetaData.getResultColumnDescriptor("PARAMETER_ID", 5, false) };
  private static final ResultSetMetaData metadata = new EmbedResultSetMetaData(columnInfo);
  
  private int translate(int paramInt)
  {
    if (!isFunction) {
      return paramInt;
    }
    switch (paramInt)
    {
    case 0: 
      return 0;
    case 1: 
      return 1;
    case 2: 
      return 2;
    case 4: 
      return 3;
    case 5: 
      return 4;
    }
    return 0;
  }
  
  public ResultSetMetaData getMetaData()
  {
    return metadata;
  }
  
  public GetProcedureColumns(AliasInfo paramAliasInfo, String paramString)
    throws SQLException
  {
    int i = -2;
    if (paramAliasInfo != null)
    {
      isProcedure = paramString.equals("P");
      isFunction = paramString.equals("F");
      procedure = ((RoutineAliasInfo)paramAliasInfo);
      method_count = ((short)procedure.getParameterCount());
      rowCount = procedure.getParameterCount();
      if (procedure.isTableFunction())
      {
        tableFunctionReturnType = procedure.getReturnType();
        returnedTableColumnCount = tableFunctionReturnType.getRowColumnNames().length;
        rowCount += returnedTableColumnCount;
        i = -1;
      }
    }
    if (paramString == null)
    {
      nullable = 0;
      return;
    }
    if (isFunction)
    {
      nullable = 1;
      sqlType = procedure.getReturnType();
      columnName = "";
      columnType = 4;
      paramCursor = i;
      return;
    }
    nullable = 1;
    paramCursor = -1;
  }
  
  public boolean next()
    throws SQLException
  {
    if (++paramCursor >= rowCount) {
      return false;
    }
    if ((procedure.isTableFunction()) && (paramCursor >= procedure.getParameterCount()))
    {
      int i = paramCursor - procedure.getParameterCount();
      sqlType = tableFunctionReturnType.getRowTypes()[i];
      columnName = tableFunctionReturnType.getRowColumnNames()[i];
      columnType = 5;
    }
    else if (paramCursor > -1)
    {
      sqlType = procedure.getParameterTypes()[paramCursor];
      columnName = procedure.getParameterNames()[paramCursor];
      columnType = ((short)translate(procedure.getParameterModes()[paramCursor]));
    }
    param_number = ((short)paramCursor);
    return true;
  }
  
  public String getString(int paramInt)
    throws SQLException
  {
    switch (paramInt)
    {
    case 1: 
      return columnName;
    case 4: 
      return sqlType.getTypeName();
    case 10: 
      return null;
    }
    return super.getString(paramInt);
  }
  
  public int getInt(int paramInt)
    throws SQLException
  {
    switch (paramInt)
    {
    case 3: 
      if (sqlType != null) {
        return sqlType.getJDBCTypeId();
      }
      return 2000;
    case 5: 
      if (sqlType != null)
      {
        int i = sqlType.getJDBCTypeId();
        if (DataTypeDescriptor.isNumericType(i)) {
          return sqlType.getPrecision();
        }
        if ((i == 91) || (i == 92) || (i == 93)) {
          return DataTypeUtilities.getColumnDisplaySize(i, -1);
        }
        return sqlType.getMaximumWidth();
      }
      return 0;
    case 6: 
      if (sqlType != null) {
        return sqlType.getMaximumWidthInBytes();
      }
      return 0;
    }
    return super.getInt(paramInt);
  }
  
  public short getShort(int paramInt)
    throws SQLException
  {
    switch (paramInt)
    {
    case 2: 
      return columnType;
    case 7: 
      if (sqlType != null) {
        return (short)sqlType.getScale();
      }
      return 0;
    case 8: 
      if (sqlType != null)
      {
        int i = sqlType.getJDBCTypeId();
        if ((i == 7) || (i == 6) || (i == 8)) {
          return 2;
        }
        return 10;
      }
      return 0;
    case 9: 
      return nullable;
    case 11: 
      return method_count;
    case 12: 
      return param_number;
    }
    return super.getShort(paramInt);
  }
  
  public void close() {}
}

/* Location:
 * Qualified Name:     org.apache.derby.catalog.GetProcedureColumns
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.derby.catalog;

public abstract interface IndexDescriptor
{
  public abstract boolean isUnique();
  
  public abstract boolean isUniqueWithDuplicateNulls();
  
  public abstract int[] baseColumnPositions();
  
  public abstract int getKeyColumnPosition(int paramInt);
  
  public abstract int numberOfOrderedColumns();
  
  public abstract String indexType();
  
  public abstract boolean[] isAscending();
  
  public abstract boolean isAscending(Integer paramInteger);
  
  public abstract boolean isDescending(Integer paramInteger);
  
  public abstract void setBaseColumnPositions(int[] paramArrayOfInt);
  
  public abstract void setIsAscending(boolean[] paramArrayOfBoolean);
  
  public abstract void setNumberOfOrderedColumns(int paramInt);
}

/* Location:
 * Qualified Name:     org.apache.derby.catalog.IndexDescriptor
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.derby.catalog;

public abstract interface ReferencedColumns
{
  public abstract int[] getReferencedColumnPositions();
  
  public abstract int[] getTriggerActionReferencedColumnPositions();
}

/* Location:
 * Qualified Name:     org.apache.derby.catalog.ReferencedColumns
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.derby.catalog;

public abstract interface Statistics
{
  public abstract long getRowEstimate();
  
  public abstract double selectivity(Object[] paramArrayOfObject);
}

/* Location:
 * Qualified Name:     org.apache.derby.catalog.Statistics
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.derby.catalog;

import java.security.Policy;
import java.security.PrivilegedAction;

final class SystemProcedures$1
  implements PrivilegedAction
{
  public Object run()
  {
    Policy.getPolicy().refresh();
    return null;
  }
}

/* Location:
 * Qualified Name:     org.apache.derby.catalog.SystemProcedures.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.derby.catalog;

import java.security.AccessController;
import java.security.Policy;
import java.security.PrivilegedAction;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.NoSuchElementException;
import java.util.Random;
import java.util.StringTokenizer;
import org.apache.derby.database.Database;
import org.apache.derby.iapi.db.ConsistencyChecker;
import org.apache.derby.iapi.db.Factory;
import org.apache.derby.iapi.db.PropertyInfo;
import org.apache.derby.iapi.error.PublicAPI;
import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.services.cache.CacheManager;
import org.apache.derby.iapi.services.i18n.MessageService;
import org.apache.derby.iapi.services.property.PropertyUtil;
import org.apache.derby.iapi.sql.conn.ConnectionUtil;
import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
import org.apache.derby.iapi.sql.conn.LanguageConnectionFactory;
import org.apache.derby.iapi.sql.dictionary.DataDictionary;
import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
import org.apache.derby.iapi.sql.execute.RunTimeStatistics;
import org.apache.derby.iapi.store.access.TransactionController;
import org.apache.derby.iapi.util.IdUtil;
import org.apache.derby.iapi.util.StringUtil;
import org.apache.derby.impl.jdbc.EmbedDatabaseMetaData;
import org.apache.derby.impl.jdbc.Util;
import org.apache.derby.impl.load.Export;
import org.apache.derby.impl.load.Import;
import org.apache.derby.impl.sql.catalog.XPLAINResultSetDescriptor;
import org.apache.derby.impl.sql.catalog.XPLAINResultSetTimingsDescriptor;
import org.apache.derby.impl.sql.catalog.XPLAINScanPropsDescriptor;
import org.apache.derby.impl.sql.catalog.XPLAINSortPropsDescriptor;
import org.apache.derby.impl.sql.catalog.XPLAINStatementDescriptor;
import org.apache.derby.impl.sql.catalog.XPLAINStatementTimingsDescriptor;
import org.apache.derby.impl.sql.catalog.XPLAINTableDescriptor;
import org.apache.derby.impl.sql.execute.JarUtil;
import org.apache.derby.jdbc.InternalDriver;

public class SystemProcedures
{
  private static final int SQL_BEST_ROWID = 1;
  private static final int SQL_ROWVER = 2;
  private static final String DRIVER_TYPE_OPTION = "DATATYPE";
  private static final String ODBC_DRIVER_OPTION = "'ODBC'";
  public static final String SQLERRMC_MESSAGE_DELIMITER = new String(new char[] { '\024', '\024', '\024' });
  private static final double LOG10 = StrictMath.log(10.0D);
  
  public static void SQLCAMESSAGE(int paramInt1, short paramShort, String paramString1, String paramString2, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, String paramString3, String paramString4, String paramString5, String paramString6, String[] paramArrayOfString, int[] paramArrayOfInt)
  {
    int i = 1;
    int j = 0;
    while (paramString1.indexOf(SQLERRMC_MESSAGE_DELIMITER, j) != -1)
    {
      j = paramString1.indexOf(SQLERRMC_MESSAGE_DELIMITER, j) + SQLERRMC_MESSAGE_DELIMITER.length();
      i++;
    }
    if (i == 1)
    {
      MessageService.getLocalizedMessage(paramInt1, paramShort, paramString1, paramString2, paramInt2, paramInt3, paramInt4, paramInt5, paramInt6, paramInt7, paramString3, paramString4, paramString5, paramString6, paramArrayOfString, paramArrayOfInt);
    }
    else
    {
      j = 0;
      String[] arrayOfString = new String[2];
      for (int m = 0; m < i; m++)
      {
        int k = paramString1.indexOf(SQLERRMC_MESSAGE_DELIMITER, j);
        String str;
        if (m == i - 1) {
          str = paramString1.substring(j);
        } else {
          str = paramString1.substring(j, k);
        }
        if (m > 0)
        {
          paramString4 = str.substring(0, 5);
          str = str.substring(6);
          int tmp179_178 = 0;
          String[] tmp179_176 = paramArrayOfString;
          tmp179_176[tmp179_178] = (tmp179_176[tmp179_178] + " SQLSTATE: " + paramString4 + ": ");
        }
        MessageService.getLocalizedMessage(paramInt1, (short)str.length(), str, paramString2, paramInt2, paramInt3, paramInt4, paramInt5, paramInt6, paramInt7, paramString3, paramString4, paramString5, paramString6, arrayOfString, paramArrayOfInt);
        if (paramArrayOfInt[0] == 0) {
          if (m == 0)
          {
            paramArrayOfString[0] = arrayOfString[0];
          }
          else
          {
            int tmp273_272 = 0;
            String[] tmp273_270 = paramArrayOfString;
            tmp273_270[tmp273_272] = (tmp273_270[tmp273_272] + arrayOfString[0]);
          }
        }
        j = k + SQLERRMC_MESSAGE_DELIMITER.length();
      }
    }
  }
  
  private static Connection getDefaultConn()
    throws SQLException
  {
    InternalDriver localInternalDriver = InternalDriver.activeDriver();
    if (localInternalDriver != null)
    {
      Connection localConnection = localInternalDriver.connect("jdbc:default:connection", null);
      if (localConnection != null) {
        return localConnection;
      }
    }
    throw Util.noCurrentConnection();
  }
  
  private static DatabaseMetaData getDMD()
    throws SQLException
  {
    Connection localConnection = getDefaultConn();
    return localConnection.getMetaData();
  }
  
  public static void SQLPROCEDURES(String paramString1, String paramString2, String paramString3, String paramString4, ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    paramArrayOfResultSet[0] = (isForODBC(paramString4) ? ((EmbedDatabaseMetaData)getDMD()).getProceduresForODBC(paramString1, paramString2, paramString3) : getDMD().getProcedures(paramString1, paramString2, paramString3));
  }
  
  public static void SQLFUNCTIONS(String paramString1, String paramString2, String paramString3, String paramString4, ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    paramArrayOfResultSet[0] = ((EmbedDatabaseMetaData)getDMD()).getFunctions(paramString1, paramString2, paramString3);
  }
  
  public static void SQLTABLES(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    String str = getOption("GETCATALOGS", paramString5);
    if ((str != null) && (str.trim().equals("1")))
    {
      paramArrayOfResultSet[0] = getDMD().getCatalogs();
      return;
    }
    str = getOption("GETTABLETYPES", paramString5);
    if ((str != null) && (str.trim().equals("1")))
    {
      paramArrayOfResultSet[0] = getDMD().getTableTypes();
      return;
    }
    str = getOption("GETSCHEMAS", paramString5);
    if (str != null)
    {
      str = str.trim();
      if (str.equals("1"))
      {
        paramArrayOfResultSet[0] = getDMD().getSchemas();
        return;
      }
      if (str.equals("2"))
      {
        localObject = (EmbedDatabaseMetaData)getDMD();
        paramArrayOfResultSet[0] = ((EmbedDatabaseMetaData)localObject).getSchemas(paramString1, paramString2);
        return;
      }
    }
    Object localObject = null;
    if (paramString4 != null)
    {
      StringTokenizer localStringTokenizer = new StringTokenizer(paramString4, "',");
      localObject = new String[localStringTokenizer.countTokens()];
      for (int i = 0; localStringTokenizer.hasMoreTokens(); i++) {
        localObject[i] = localStringTokenizer.nextToken();
      }
    }
    paramArrayOfResultSet[0] = getDMD().getTables(paramString1, paramString2, paramString3, (String[])localObject);
  }
  
  public static void SQLFOREIGNKEYS(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6, String paramString7, ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    String str1 = getOption("EXPORTEDKEY", paramString7);
    String str2 = getOption("IMPORTEDKEY", paramString7);
    if ((str2 != null) && (str2.trim().equals("1"))) {
      paramArrayOfResultSet[0] = getDMD().getImportedKeys(paramString4, paramString5, paramString6);
    } else if ((str1 != null) && (str1.trim().equals("1"))) {
      paramArrayOfResultSet[0] = getDMD().getExportedKeys(paramString1, paramString2, paramString3);
    } else {
      paramArrayOfResultSet[0] = (isForODBC(paramString7) ? ((EmbedDatabaseMetaData)getDMD()).getCrossReferenceForODBC(paramString1, paramString2, paramString3, paramString4, paramString5, paramString6) : getDMD().getCrossReference(paramString1, paramString2, paramString3, paramString4, paramString5, paramString6));
    }
  }
  
  private static String getOption(String paramString1, String paramString2)
  {
    if (paramString2 == null) {
      return null;
    }
    int i = paramString2.lastIndexOf(paramString1);
    if (i < 0) {
      return null;
    }
    int j = paramString2.indexOf('=', i);
    if (j < 0) {
      return null;
    }
    int k = paramString2.indexOf(';', j);
    if (k < 0) {
      return paramString2.substring(j + 1);
    }
    return paramString2.substring(j + 1, k);
  }
  
  public static void SQLPROCEDURECOLS(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    paramArrayOfResultSet[0] = (isForODBC(paramString5) ? ((EmbedDatabaseMetaData)getDMD()).getProcedureColumnsForODBC(paramString1, paramString2, paramString3, paramString4) : getDMD().getProcedureColumns(paramString1, paramString2, paramString3, paramString4));
  }
  
  public static void SQLFUNCTIONPARAMS(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    paramArrayOfResultSet[0] = ((EmbedDatabaseMetaData)getDMD()).getFunctionColumns(paramString1, paramString2, paramString3, paramString4);
  }
  
  public static void SQLCOLUMNS(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    paramArrayOfResultSet[0] = (isForODBC(paramString5) ? ((EmbedDatabaseMetaData)getDMD()).getColumnsForODBC(paramString1, paramString2, paramString3, paramString4) : getDMD().getColumns(paramString1, paramString2, paramString3, paramString4));
  }
  
  public static void SQLCOLPRIVILEGES(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    paramArrayOfResultSet[0] = getDMD().getColumnPrivileges(paramString1, paramString2, paramString3, paramString4);
  }
  
  public static void SQLTABLEPRIVILEGES(String paramString1, String paramString2, String paramString3, String paramString4, ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    paramArrayOfResultSet[0] = getDMD().getTablePrivileges(paramString1, paramString2, paramString3);
  }
  
  public static void SQLPRIMARYKEYS(String paramString1, String paramString2, String paramString3, String paramString4, ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    paramArrayOfResultSet[0] = getDMD().getPrimaryKeys(paramString1, paramString2, paramString3);
  }
  
  public static void SQLGETTYPEINFO(short paramShort, String paramString, ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    paramArrayOfResultSet[0] = (isForODBC(paramString) ? ((EmbedDatabaseMetaData)getDMD()).getTypeInfoForODBC() : getDMD().getTypeInfo());
  }
  
  public static void SQLSTATISTICS(String paramString1, String paramString2, String paramString3, short paramShort1, short paramShort2, String paramString4, ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    boolean bool1 = paramShort1 == 0;
    boolean bool2 = paramShort2 == 1;
    paramArrayOfResultSet[0] = (isForODBC(paramString4) ? ((EmbedDatabaseMetaData)getDMD()).getIndexInfoForODBC(paramString1, paramString2, paramString3, bool1, bool2) : getDMD().getIndexInfo(paramString1, paramString2, paramString3, bool1, bool2));
  }
  
  public static void SQLSPECIALCOLUMNS(short paramShort1, String paramString1, String paramString2, String paramString3, short paramShort2, short paramShort3, String paramString4, ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    boolean bool = paramShort3 == 1;
    if (paramShort1 == 1) {
      paramArrayOfResultSet[0] = (isForODBC(paramString4) ? ((EmbedDatabaseMetaData)getDMD()).getBestRowIdentifierForODBC(paramString1, paramString2, paramString3, paramShort2, bool) : getDMD().getBestRowIdentifier(paramString1, paramString2, paramString3, paramShort2, bool));
    } else {
      paramArrayOfResultSet[0] = (isForODBC(paramString4) ? ((EmbedDatabaseMetaData)getDMD()).getVersionColumnsForODBC(paramString1, paramString2, paramString3) : getDMD().getVersionColumns(paramString1, paramString2, paramString3));
    }
  }
  
  public static void SQLUDTS(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    int[] arrayOfInt = null;
    if ((paramString4 != null) && (paramString4.length() > 0))
    {
      StringTokenizer localStringTokenizer = new StringTokenizer(paramString4, " \t\n\t,");
      int i = localStringTokenizer.countTokens();
      arrayOfInt = new int[i];
      String str = "";
      try
      {
        for (int j = 0; j < i; j++)
        {
          str = localStringTokenizer.nextToken();
          arrayOfInt[j] = Integer.parseInt(str);
        }
      }
      catch (NumberFormatException localNumberFormatException)
      {
        throw new SQLException("Invalid type, " + str + ", passed to getUDTs.");
      }
      catch (NoSuchElementException localNoSuchElementException)
      {
        throw new SQLException("Internal failure: NoSuchElementException in getUDTs.");
      }
    }
    paramArrayOfResultSet[0] = getDMD().getUDTs(paramString1, paramString2, paramString3, arrayOfInt);
  }
  
  public static void METADATA(ResultSet[] paramArrayOfResultSet)
    throws SQLException
  {
    paramArrayOfResultSet[0] = ((EmbedDatabaseMetaData)getDMD()).getClientCachedMetaData();
  }
  
  private static boolean isForODBC(String paramString)
  {
    String str = getOption("DATATYPE", paramString);
    return (str != null) && (str.toUpperCase().equals("'ODBC'"));
  }
  
  public static void SYSCS_SET_DATABASE_PROPERTY(String paramString1, String paramString2)
    throws SQLException
  {
    PropertyInfo.setDatabaseProperty(paramString1, paramString2);
  }
  
  public static String SYSCS_GET_DATABASE_PROPERTY(String paramString)
    throws SQLException
  {
    LanguageConnectionContext localLanguageConnectionContext = ConnectionUtil.getCurrentLCC();
    try
    {
      return PropertyUtil.getDatabaseProperty(localLanguageConnectionContext.getTransactionExecute(), paramString);
    }
    catch (StandardException localStandardException)
    {
      throw PublicAPI.wrapStandardException(localStandardException);
    }
  }
  
  public static void SYSCS_UPDATE_STATISTICS(String paramString1, String paramString2, String paramString3)
    throws SQLException
  {
    String str1 = IdUtil.normalToDelimited(paramString1);
    String str2 = IdUtil.normalToDelimited(paramString2);
    String str3 = "alter table " + str1 + "." + str2;
    if (paramString3 == null) {
      str3 = str3 + " all update statistics ";
    } else {
      str3 = str3 + " update statistics " + IdUtil.normalToDelimited(paramString3);
    }
    Connection localConnection = getDefaultConn();
    PreparedStatement localPreparedStatement = localConnection.prepareStatement(str3);
    localPreparedStatement.executeUpdate();
    localPreparedStatement.close();
    localConnection.close();
  }
  
  public static void SYSCS_COMPRESS_TABLE(String paramString1, String paramString2, short paramShort)
    throws SQLException
  {
    String str1 = IdUtil.normalToDelimited(paramString1);
    String str2 = IdUtil.normalToDelimited(paramString2);
    String str3 = "alter table " + str1 + "." + str2 + " compress" + (paramShort != 0 ? " sequential" : "");
    Connection localConnection = getDefaultConn();
    PreparedStatement localPreparedStatement = localConnection.prepareStatement(str3);
    localPreparedStatement.executeUpdate();
    localPreparedStatement.close();
    localConnection.close();
  }
  
  public static void SYSCS_FREEZE_DATABASE()
    throws SQLException
  {
    Factory.getDatabaseOfConnection().freeze();
  }
  
  public static void SYSCS_UNFREEZE_DATABASE()
    throws SQLException
  {
    Factory.getDatabaseOfConnection().unfreeze();
  }
  
  public static void SYSCS_CHECKPOINT_DATABASE()
    throws SQLException
  {
    Factory.getDatabaseOfConnection().checkpoint();
  }
  
  public static void SYSCS_BACKUP_DATABASE(String paramString)
    throws SQLException
  {
    Factory.getDatabaseOfConnection().backup(paramString, true);
  }
  
  public static void SYSCS_BACKUP_DATABASE_NOWAIT(String paramString)
    throws SQLException
  {
    Factory.getDatabaseOfConnection().backup(paramString, false);
  }
  
  public static void SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(String paramString, short paramShort)
    throws SQLException
  {
    Factory.getDatabaseOfConnection().backupAndEnableLogArchiveMode(paramString, paramShort != 0, true);
  }
  
  public static void SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE_NOWAIT(String paramString, short paramShort)
    throws SQLException
  {
    Factory.getDatabaseOfConnection().backupAndEnableLogArchiveMode(paramString, paramShort != 0, false);
  }
  
  public static void SYSCS_DISABLE_LOG_ARCHIVE_MODE(short paramShort)
    throws SQLException
  {
    Factory.getDatabaseOfConnection().disableLogArchiveMode(paramShort != 0);
  }
  
  public static void SYSCS_SET_RUNTIMESTATISTICS(short paramShort)
    throws SQLException
  {
    ConnectionUtil.getCurrentLCC().setRunTimeStatisticsMode(paramShort != 0);
  }
  
  public static void SYSCS_SET_STATISTICS_TIMING(short paramShort)
    throws SQLException
  {
    ConnectionUtil.getCurrentLCC().setStatisticsTiming(paramShort != 0);
  }
  
  public static int SYSCS_CHECK_TABLE(String paramString1, String paramString2)
    throws SQLException
  {
    boolean bool = ConsistencyChecker.checkTable(paramString1, paramString2);
    return bool ? 1 : 0;
  }
  
  public static void SYSCS_INPLACE_COMPRESS_TABLE(String paramString1, String paramString2, short paramShort1, short paramShort2, short paramShort3)
    throws SQLException
  {
    LanguageConnectionContext localLanguageConnectionContext = ConnectionUtil.getCurrentLCC();
    TransactionController localTransactionController = localLanguageConnectionContext.getTransactionExecute();
    try
    {
      DataDictionary localDataDictionary = localLanguageConnectionContext.getDataDictionary();
      localObject1 = localDataDictionary.getSchemaDescriptor(paramString1, localTransactionController, true);
      localObject2 = localDataDictionary.getTableDescriptor(paramString2, (SchemaDescriptor)localObject1, localTransactionController);
      if ((localObject2 != null) && (((TableDescriptor)localObject2).getTableType() == 5)) {
        return;
      }
    }
    catch (StandardException localStandardException)
    {
      throw PublicAPI.wrapStandardException(localStandardException);
    }
    String str = IdUtil.normalToDelimited(paramString1);
    Object localObject1 = IdUtil.normalToDelimited(paramString2);
    Object localObject2 = "alter table " + str + "." + (String)localObject1 + " compress inplace" + (paramShort1 != 0 ? " purge" : "") + (paramShort2 != 0 ? " defragment" : "") + (paramShort3 != 0 ? " truncate_end" : "");
    Connection localConnection = getDefaultConn();
    PreparedStatement localPreparedStatement = localConnection.prepareStatement((String)localObject2);
    localPreparedStatement.executeUpdate();
    localPreparedStatement.close();
    localConnection.close();
  }
  
  public static String SYSCS_GET_RUNTIMESTATISTICS()
    throws SQLException
  {
    RunTimeStatistics localRunTimeStatistics = ConnectionUtil.getCurrentLCC().getRunTimeStatisticsObject();
    if (localRunTimeStatistics == null) {
      return null;
    }
    return localRunTimeStatistics.toString();
  }
  
  public static void INSTALL_JAR(String paramString1, String paramString2, int paramInt)
    throws SQLException
  {
    try
    {
      LanguageConnectionContext localLanguageConnectionContext = ConnectionUtil.getCurrentLCC();
      String[] arrayOfString = IdUtil.parseMultiPartSQLIdentifier(paramString2.trim());
      String str1;
      String str2;
      if (arrayOfString.length == 1)
      {
        str1 = localLanguageConnectionContext.getCurrentSchemaName();
        str2 = arrayOfString[0];
      }
      else
      {
        str1 = arrayOfString[0];
        str2 = arrayOfString[1];
      }
      checkJarSQLName(str2);
      JarUtil.install(localLanguageConnectionContext, str1, str2, paramString1);
    }
    catch (StandardException localStandardException)
    {
      throw PublicAPI.wrapStandardException(localStandardException);
    }
  }
  
  public static void REPLACE_JAR(String paramString1, String paramString2)
    throws SQLException
  {
    try
    {
      LanguageConnectionContext localLanguageConnectionContext = ConnectionUtil.getCurrentLCC();
      String[] arrayOfString = IdUtil.parseMultiPartSQLIdentifier(paramString2.trim());
      String str1;
      String str2;
      if (arrayOfString.length == 1)
      {
        str1 = localLanguageConnectionContext.getCurrentSchemaName();
        str2 = arrayOfString[0];
      }
      else
      {
        str1 = arrayOfString[0];
        str2 = arrayOfString[1];
      }
      checkJarSQLName(str2);
      JarUtil.replace(localLanguageConnectionContext, str1, str2, paramString1);
    }
    catch (StandardException localStandardException)
    {
      throw PublicAPI.wrapStandardException(localStandardException);
    }
  }
  
  public static void REMOVE_JAR(String paramString, int paramInt)
    throws SQLException
  {
    try
    {
      LanguageConnectionContext localLanguageConnectionContext = ConnectionUtil.getCurrentLCC();
      String[] arrayOfString = IdUtil.parseMultiPartSQLIdentifier(paramString.trim());
      String str1;
      String str2;
      if (arrayOfString.length == 1)
      {
        str1 = localLanguageConnectionContext.getCurrentSchemaName();
        str2 = arrayOfString[0];
      }
      else
      {
        str1 = arrayOfString[0];
        str2 = arrayOfString[1];
      }
      checkJarSQLName(str2);
      JarUtil.drop(localLanguageConnectionContext, str1, str2);
    }
    catch (StandardException localStandardException)
    {
      throw PublicAPI.wrapStandardException(localStandardException);
    }
  }
  
  private static void checkJarSQLName(String paramString)
    throws StandardException
  {
    if ((paramString.length() == 0) || (paramString.indexOf(':') != -1)) {
      throw StandardException.newException("XCXA0.S");
    }
  }
  
  public static void SYSCS_EXPORT_TABLE(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6)
    throws SQLException
  {
    Connection localConnection = getDefaultConn();
    Export.exportTable(localConnection, paramString1, paramString2, paramString3, paramString4, paramString5, paramString6);
    localConnection.commit();
  }
  
  public static void SYSCS_EXPORT_TABLE_LOBS_TO_EXTFILE(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6, String paramString7)
    throws SQLException
  {
    Connection localConnection = getDefaultConn();
    Export.exportTable(localConnection, paramString1, paramString2, paramString3, paramString4, paramString5, paramString6, paramString7);
    localConnection.commit();
  }
  
  public static void SYSCS_EXPORT_QUERY(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5)
    throws SQLException
  {
    Connection localConnection = getDefaultConn();
    Export.exportQuery(localConnection, paramString1, paramString2, paramString3, paramString4, paramString5);
    localConnection.commit();
  }
  
  public static void SYSCS_EXPORT_QUERY_LOBS_TO_EXTFILE(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6)
    throws SQLException
  {
    Connection localConnection = getDefaultConn();
    Export.exportQuery(localConnection, paramString1, paramString2, paramString3, paramString4, paramString5, paramString6);
    localConnection.commit();
  }
  
  public static void SYSCS_IMPORT_TABLE(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6, short paramShort)
    throws SQLException
  {
    Connection localConnection = getDefaultConn();
    try
    {
      Import.importTable(localConnection, paramString1, paramString2, paramString3, paramString4, paramString5, paramString6, paramShort, false);
    }
    catch (SQLException localSQLException)
    {
      rollBackAndThrowSQLException(localConnection, localSQLException);
    }
    localConnection.commit();
  }
  
  private static void rollBackAndThrowSQLException(Connection paramConnection, SQLException paramSQLException)
    throws SQLException
  {
    try
    {
      paramConnection.rollback();
    }
    catch (SQLException localSQLException)
    {
      paramSQLException.setNextException(localSQLException);
    }
    throw paramSQLException;
  }
  
  public static void SYSCS_IMPORT_TABLE_LOBS_FROM_EXTFILE(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6, short paramShort)
    throws SQLException
  {
    Connection localConnection = getDefaultConn();
    try
    {
      Import.importTable(localConnection, paramString1, paramString2, paramString3, paramString4, paramString5, paramString6, paramShort, true);
    }
    catch (SQLException localSQLException)
    {
      rollBackAndThrowSQLException(localConnection, localSQLException);
    }
    localConnection.commit();
  }
  
  public static void SYSCS_IMPORT_DATA(String paramString1, S
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229

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