Package de.iritgo.aktera.persist

Examples of de.iritgo.aktera.persist.PersistenceException


      createIndices(pmd, myConnection, true);
    }
    catch (Exception e)
    {
      log.error("Error building create statement", e);
      throw new PersistenceException("Unable to build/execute create statement '" + createStatement.toString()
              + "' for table '" + pmd.getTableName() + "'", e);
    }
    finally
    {
      try
      {
        if (myConnection != null)
        {
          myConnection.close();
        }
      }
      catch (SQLException se)
      {
        throw new PersistenceException("Unable to close/release connection", se);
      }
    }
  }
View Full Code Here


      /* for each index */
    }
    catch (SQLException s)
    {
      throw new PersistenceException(s);
    }
    finally
    {
      try
      {
        stmt.close();
      }
      catch (SQLException s)
      {
        throw new PersistenceException("Unable to close statement when creating index", s);
      }
    }
  }
View Full Code Here

      myConnection = dataSource.getConnection();
      createIndices(pmd, myConnection, false);
    }
    catch (SQLException s)
    {
      throw new PersistenceException(s);
    }
    finally
    {
      try
      {
        myConnection.close();
      }
      catch (SQLException s)
      {
        throw new PersistenceException("Unable to close connection when creating indices", s);
      }
    }
  }
View Full Code Here

      /* for each index */
    }
    catch (SQLException s)
    {
      throw new PersistenceException(s);
    }
    finally
    {
      try
      {
View Full Code Here

    {
      myConnection = ds.getConnection();

      if (myConnection == null)
      {
        throw new PersistenceException("Got a null connection from data source " + ds.toString());
      }

      DatabaseMetaData dm = myConnection.getMetaData();

      if (dm.supportsTransactions())
      {
        supportsTransactions = true;
      }
      else
      {
        supportsTransactions = false;
      }

      ResultSet rsx = dm.getTypeInfo();

      while (rsx.next())
      {
        TypeMapEntry oneType = new TypeMapEntry();

        //--- quikdraw: Changed the resultSet extraction from indexes to
        //  column names as defined in the Sun JavaDoc for JDBC.
        oneType.setTypeName(rsx.getString("TYPE_NAME"));
        oneType.setDataType(rsx.getShort("DATA_TYPE"));

        try
        {
          oneType.setPrecision(rsx.getInt("PRECISION"));
        }
        catch (Exception e)
        {
          log.warn("Driver returned bad precision, setting to 0");
          oneType.setPrecision(0);
        }

        oneType.setLiteralPrefix(rsx.getString("LITERAL_PREFIX"));
        oneType.setLiteralSuffix(rsx.getString("LITERAL_SUFFIX"));
        oneType.setCreateParams(rsx.getString("CREATE_PARAMS"));
        oneType.setNullable(rsx.getShort("NULLABLE"));
        oneType.setCaseSensitive(rsx.getBoolean("CASE_SENSITIVE"));
        oneType.setSearchable(rsx.getShort("SEARCHABLE"));
        oneType.setUnsigned(rsx.getBoolean("UNSIGNED_ATTRIBUTE"));
        oneType.setFixedPrecision(rsx.getBoolean("FIXED_PREC_SCALE"));
        oneType.setAutoIncrement(rsx.getBoolean("AUTO_INCREMENT"));
        oneType.setLocalTypeName(rsx.getString("LOCAL_TYPE_NAME"));
        oneType.setMinScale(rsx.getShort("MINIMUM_SCALE"));
        oneType.setMaxScale(rsx.getShort("MAXIMUM_SCALE"));
        //--- quikdraw: This was index 16, but the JavaDoc for DatabaseMetaData
        //  states the index for the Radix is 18.
        oneType.setNumPrecRadix(rsx.getInt("NUM_PREC_RADIX"));

        String typeAsString = typeToString(oneType.getDataType());

        TypeMapEntry oldType = (TypeMapEntry) mapByType.get(typeAsString);

        if (oldType == null)
        {
          mapByType.put(typeAsString, oneType);
        }
        else
        {
          dups.add(typeAsString);
        }
      }
    }
    catch (SQLException se)
    {
      throw new PersistenceException(se);
    }
    finally
    {
      try
      {
        if (myConnection != null)
        {
          myConnection.close();
        }
      }
      catch (SQLException se)
      {
        throw new PersistenceException(se);
      }
    }

    if (dups.size() > 0)
    {
View Full Code Here

        {
          myConnection.close();
        }
        catch (SQLException se)
        {
          throw new PersistenceException(se);
        }
      }
    }

    return returnValue;
View Full Code Here

    {
      bArray = rs.getBytes(index);
    }
    catch (java.sql.SQLException sqe)
    {
      throw new PersistenceException("An error occured while trying to fetch a BLOB from field " + fieldName
              + ", error: " + sqe.toString());
    }

    return bArray;
  }
View Full Code Here

        allLines.add(oneLine);
      }
    }
    catch (java.sql.SQLException sqe)
    {
      throw new PersistenceException("An error occured while trying to fetch a BLOB from field " + fieldName
              + ", error: " + sqe.toString());
    }
    catch (java.io.IOException ioe)
    {
      throw new PersistenceException("An error occured while trying to fetch a BLOB from field " + fieldName
              + ", error: " + ioe.toString());
    }

    return allLines;
  }
View Full Code Here

  /* @see de.iritgo.aktera.persist.DatabaseType#getCreateIdentitySyntax()
   */
  public String getCreateIdentitySyntax() throws PersistenceException
  {
    throw new PersistenceException("SQL Identity not supported");
  }
View Full Code Here

  /* @see de.iritgo.aktera.persist.DatabaseType#getCreateSequenceSyntax(String)
   */
  public String getCreateSequenceSyntax(String sequenceName) throws PersistenceException
  {
    throw new PersistenceException("SQL Sequence not supported");
  }
View Full Code Here

TOP

Related Classes of de.iritgo.aktera.persist.PersistenceException

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.