Package org.jpox.exceptions

Examples of org.jpox.exceptions.JPOXDataStoreException


            if (fmd.isSerialized())
            {
                // Serialised field so just perform basic Java serialisation for retrieval
                if (!(value instanceof Serializable))
                {
                    throw new JPOXDataStoreException(LOCALISER.msg("055005", value.getClass().getName()));
                }
                BlobImpl b = new BlobImpl(value);
                bytes = b.getBytes(0, (int) b.length());
            }
            else if (value instanceof java.util.BitSet)
            {
                bytes = TypeConversionHelper.getByteArrayFromBooleanArray(TypeConversionHelper.getBooleanArrayFromBitSet((java.util.BitSet) value));
            }
            else
            {
                // Fall back to just perform Java serialisation for storage
                if (!(value instanceof Serializable))
                {
                    throw new JPOXDataStoreException(LOCALISER.msg("055005", value.getClass().getName()));
                }
                BlobImpl b = new BlobImpl(value);
                bytes = b.getBytes(0, (int) b.length());
            }
        }
        catch (SQLException e)
        {
            throw new JPOXDataStoreException(LOCALISER.msg("055001", "Object", "" + value, fmd, e.getMessage()), e);
        }
        catch (IOException e1)
        {
            // Do nothing
        }
View Full Code Here


        {
            log(conn.getWarnings());
        }
        catch (SQLException e)
        {
            throw new JPOXDataStoreException(LOCALISER.msg("052701",conn),e);
        }
    }
View Full Code Here

        {
            log(stmt.getWarnings());
        }
        catch (SQLException e)
        {
            throw new JPOXDataStoreException(LOCALISER.msg("052702",stmt), e);
        }
    }
View Full Code Here

        {
            log(rs.getWarnings());
        }
        catch (SQLException e)
        {
            throw new JPOXDataStoreException(LOCALISER.msg("052703",rs), e);
        }
    }
View Full Code Here

                rs.close();
            }
        }
        catch (SQLException sqle)
        {
            throw new JPOXDataStoreException("Exception thrown obtaining schema table information from datastore", sqle);
        }

        // Retrieve column info
        try
        {
            // Get columns for this catalog, schema
            Connection conn = (Connection)mconn.getConnection();
            ResultSet rs = ((RDBMSAdapter)storeMgr.getDatastoreAdapter()).getColumns(conn,
                storeMgr.getCatalogName(), storeMgr.getSchemaName(), null);
            while (rs.next())
            {
                // Construct a fully-qualified name for the table in this row of the ResultSet
                String tableIdentifierCatalogName = rs.getString(1);
                String tableIdentifierSchemaName = rs.getString(2);
                String tableIdentifierTableName = rs.getString(3);

                if (rs.wasNull() ||
                    (tableIdentifierCatalogName != null && tableIdentifierCatalogName.length() < 1))
                {
                    tableIdentifierCatalogName = null;
                }
                if (rs.wasNull() ||
                    (tableIdentifierSchemaName != null && tableIdentifierSchemaName.length() < 1))
                {
                    tableIdentifierSchemaName = null;
                }
                if (rs.wasNull() ||
                    (tableIdentifierTableName != null && tableIdentifierTableName.length() < 1))
                {
                    tableIdentifierTableName = null;
                }
                //at least the JDBC driver should return the table name
                if (tableIdentifierTableName == null)
                {
                    throw new JPOXDataStoreException("Invalid 'null' table name identifier returned by database. Check with your JDBC driver vendor (ref:DatabaseMetaData.getColumns).");
                }

                // TODO This should create RDBMSColumnInfo
                ((RDBMSAdapter)storeMgr.getDatastoreAdapter()).newColumnInfo(rs);
            }
        }
        catch (SQLException sqle)
        {
            throw new JPOXDataStoreException("Exception thrown obtaining schema column information from datastore", sqle);
        }

        schemaDataByName.put("tables", schema);
    }
View Full Code Here

            }
        }
        catch (SQLException sqe)
        {
            JPOXLogger.DATASTORE.error(sqe);
            throw new JPOXDataStoreException(sqe.toString());
        }

        return className;
    }
View Full Code Here

            }
        }
        catch (SQLException sqe)
        {
            JPOXLogger.DATASTORE.error(sqe);
            throw new JPOXDataStoreException(sqe.toString());
        }

        return className;
    }
View Full Code Here

                    while((e = e.getNextException())!=null)
                    {
                        exceptions.add(e);
                    }
                    // TODO Localise this
                    throw new JPOXDataStoreException("Exception thrown flushing changes to datastore", e);
                }
            }

            public void managedConnectionPreClose() {}
            public void managedConnectionPostClose() {}
View Full Code Here

        {
            ((PreparedStatement) ps).setInt(param,value);                
        }
        catch (SQLException e)
        {
            throw new JPOXDataStoreException(LOCALISER.msg("055001","char", "" + value, column, e.getMessage()), e);
        }
    }
View Full Code Here

        {
            value = (char)((ResultSet) rs).getInt(param);
        }
        catch (SQLException e)
        {
            throw new JPOXDataStoreException(LOCALISER.msg("055002","char", "" + param, column, e.getMessage()), e);
        }
        return value;
    }
View Full Code Here

TOP

Related Classes of org.jpox.exceptions.JPOXDataStoreException

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.