Package org.apache.derby.iapi.sql.dictionary

Examples of org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor


    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = exFactory.getIndexableRow(2);
    keyRow.setColumn(1, nameOrderable);
    keyRow.setColumn(2, schemaIDOrderable);
    FileInfoDescriptor r = (FileInfoDescriptor)
          getDescriptorViaIndex(
            SYSFILESRowFactory.SYSFILES_INDEX1_ID,
            keyRow,
            (ScanQualifier [][]) null,
            ti,
View Full Code Here


    {
      for (int ix=0;ix<dbcp.length;ix++)
      {
        SchemaDescriptor sd = dd.getSchemaDescriptor(dbcp[ix][IdUtil.DBCP_SCHEMA_NAME], null, false);

                FileInfoDescriptor fid = null
        if (sd != null)
          fid = dd.getFileInfoDescriptor(sd,dbcp[ix][IdUtil.DBCP_SQL_JAR_NAME]);     

        if (fid == null){
          throw StandardException.newException(SQLState.LANG_DB_CLASS_PATH_HAS_MISSING_JAR            , IdUtil.mkQualifiedName(dbcp[ix]));
View Full Code Here

    DataDictionaryContext ddc =
      (DataDictionaryContext) ContextService.getContext(DataDictionaryContext.CONTEXT_ID);
    DataDictionary dd = ddc.getDataDictionary();

    SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
    FileInfoDescriptor fid = dd.getFileInfoDescriptor(sd,sqlName);
    if (fid == null)
      throw StandardException.newException(SQLState.LANG_FILE_DOES_NOT_EXIST, sqlName,schemaName);

    long generationId = fid.getGenerationId();

    FileResource fr = af.getTransaction(ddc.getContextManager()).getFileHandler();

    String externalName = org.apache.derby.impl.sql.execute.JarDDL.mkExternalName(schemaName, sqlName, fr.getSeparatorChar());
View Full Code Here

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = exFactory.getIndexableRow(2);
    keyRow.setColumn(1, nameOrderable);
    keyRow.setColumn(2, schemaIDOrderable);
    FileInfoDescriptor r = (FileInfoDescriptor)
          getDescriptorViaIndex(
            SYSFILESRowFactory.SYSFILES_INDEX1_ID,
            keyRow,
            (ScanQualifier [][]) null,
            ti,
View Full Code Here

  private long add(final InputStream is) throws StandardException
  {
    //
    //Like create table we say we are writing before we read the dd
    dd.startWriting(lcc);
    FileInfoDescriptor fid = getInfo();
    if (fid != null)
      throw
        StandardException.newException(SQLState.LANG_OBJECT_ALREADY_EXISTS_IN_OBJECT,
                         fid.getDescriptorType(), sqlName, fid.getSchemaDescriptor().getDescriptorType(), schemaName);

        SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
        try {
            notifyLoader(false);
            dd.invalidateAllSPSPlans();
View Full Code Here

  private void drop() throws StandardException
  {
    //
    //Like create table we say we are writing before we read the dd
    dd.startWriting(lcc);
    FileInfoDescriptor fid = getInfo();
    if (fid == null)
      throw StandardException.newException(SQLState.LANG_FILE_DOES_NOT_EXIST, sqlName,schemaName);

    String dbcp_s = PropertyUtil.getServiceProperty(lcc.getTransactionExecute(),Property.DATABASE_CLASSPATH);
    if (dbcp_s != null)
    {
      String[][]dbcp= IdUtil.parseDbClassPath(dbcp_s);
      boolean found = false;
      //
      //Look for the jar we are dropping on our database classpath.
      //We don't concern ourselves with 3 part names since they may
      //refer to a jar file in another database and may not occur in
      //a database classpath that is stored in the propert congomerate.
      for (int ix=0;ix<dbcp.length;ix++)
        if (dbcp.length == 2 &&
          dbcp[ix][0].equals(schemaName) && dbcp[ix][1].equals(sqlName))
          found = true;
      if (found)
        throw StandardException.newException(SQLState.LANG_CANT_DROP_JAR_ON_DB_CLASS_PATH_DURING_EXECUTION,
                  IdUtil.mkQualifiedName(schemaName,sqlName),
                  dbcp_s);
    }

    try {
   
      notifyLoader(false);
      dd.invalidateAllSPSPlans();
      DependencyManager dm = dd.getDependencyManager();
      dm.invalidateFor(fid, DependencyManager.DROP_JAR, lcc);

      dd.dropFileInfoDescriptor(fid);

      fr.remove(JarUtil.mkExternalName(schemaName, sqlName, fr.getSeparatorChar()),
        fid.getGenerationId());
    } finally {
      notifyLoader(true);
    }
  }
View Full Code Here

    //Like create table we say we are writing before we read the dd
    dd.startWriting(lcc);

    //
    //Temporarily drop the FileInfoDescriptor from the data dictionary.
    FileInfoDescriptor fid = getInfo();
    if (fid == null)
      throw StandardException.newException(SQLState.LANG_FILE_DOES_NOT_EXIST, sqlName,schemaName);

    try {
      // disable loads from this jar
      notifyLoader(false);
      dd.invalidateAllSPSPlans();
      dd.dropFileInfoDescriptor(fid);
            final String jarExternalName =
                JarUtil.mkExternalName(schemaName, sqlName, fr.getSeparatorChar());

      //
      //Replace the file.
      long generationId = setJar(jarExternalName, is, false,
          fid.getGenerationId());
           
      //
      //Re-add the descriptor to the data dictionary.
      FileInfoDescriptor fid2 =
        ddg.newFileInfoDescriptor(fid.getUUID(),fid.getSchemaDescriptor(),
                sqlName,generationId);
      dd.addDescriptor(fid2, fid.getSchemaDescriptor(),
               DataDictionary.SYSFILES_CATALOG_NUM, false, lcc.getTransactionExecute());
      return generationId;
View Full Code Here

   
    ExecRow              row;

    if (td != null
    {
      FileInfoDescriptor descriptor = (FileInfoDescriptor)td;
      id_S = descriptor.getUUID().toString();
      schemaId_S = descriptor.getSchemaDescriptor().getUUID().toString();
      SQLname = descriptor.getName();
      generationId = descriptor.getGenerationId();
    }
 
    /* Build the row to insert  */
    row = getExecutionFactory().getValueRow(SYSFILES_COLUMN_COUNT);

View Full Code Here

    String  name;
    long     generationId;
    DataValueDescriptor  col;

    SchemaDescriptor  schemaDescriptor;
    FileInfoDescriptor  result;

    /* 1st column is ID (UUID - char(36)) */
    col = row.getColumn(ID_COL_NUM);
    id_S = col.getString();
    id = getUUIDFactory().recreateUUID(id_S);
View Full Code Here

    {
      for (int ix=0;ix<dbcp.length;ix++)
      {
        SchemaDescriptor sd = dd.getSchemaDescriptor(dbcp[ix][IdUtil.DBCP_SCHEMA_NAME], null, false);

                FileInfoDescriptor fid = null
        if (sd != null)
          fid = dd.getFileInfoDescriptor(sd,dbcp[ix][IdUtil.DBCP_SQL_JAR_NAME]);     

        if (fid == null){
          throw StandardException.newException(SQLState.LANG_DB_CLASS_PATH_HAS_MISSING_JAR            , IdUtil.mkQualifiedName(dbcp[ix]));
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.