Package javax.jdo

Examples of javax.jdo.JDOFatalException


            resultStream = new PrintStream(new FileOutputStream(file));
            for (Iterator it = supportedOptions.iterator(); it.hasNext();) {
                resultStream.println((String)it.next());
            }
        } catch (FileNotFoundException e) {
            throw new JDOFatalException(
                "dumpSupportedOptions: cannot create file " + file.getName(), e);
        } finally {
            if (resultStream != null)
                resultStream.close();
        }
View Full Code Here


                    oos.writeObject(obj);
                    ois = new ObjectInputStream(new ByteArrayInputStream(
                            byteArrayOutputStream.toByteArray()));
                    result = ois.readObject();
                } catch (IOException e) {
                    throw new JDOFatalException(e.getMessage(), e);
                } catch (ClassNotFoundException e) {
                    throw new JDOFatalException(e.getMessage(), e);
                } finally {
                    try {
                        if (oos != null) {
                            oos.close();
                        }
                        if (ois != null) {
                            ois.close();
                        }
                    } catch (IOException e) {
                        throw new JDOFatalException(e.getMessage(), e);
                    }
                }
                break;  
               
            default:
View Full Code Here

                if (stream != null) {
                    Properties drivers = new Properties();
                    try {
                        drivers.load(stream);
                    } catch (IOException e) {
                        throw new JDOFatalException(I18N.msg("E_no_drivers_props"));
                    }
   
                    String driverInfo = drivers.getProperty(connectionDriverName);
                    if (driverInfo != null) {
                        String[] driverParts = driverInfo.split(",");
                        driverClass = driverParts[0];
                        // Munge the properties
                        setNextIDStatement(driverParts[1].trim());
                        setLastIDStatement(driverParts[2].trim());
                    }
                } // could read drivers.properties
            } // connectionDriverName was specified
        }
        if (driverClass != null) {
            try {
                driverImpl = Class.forName(driverClass);
            } catch (ClassNotFoundException e) {
                throw new JDOFatalException(I18N.msg("E_no_driver_class", driverClass));
            }
        } else {
            throw new JDOFatalException(I18N.msg("E_no_driver", connectionDriverName));
        }     
    }
View Full Code Here

    public DatastoreDriver getDriver() {
        BaseSQLDriver driver = null;
        try {
            driver = (BaseSQLDriver) driverImpl.newInstance();
        } catch (InstantiationException e) {
            throw new JDOFatalException(I18N.msg("E_instantiation", driverImpl.getName()));
        } catch (IllegalAccessException e) {
            throw new JDOFatalException(I18N.msg("E_illegal_access", driverImpl.getName()));
        }
 
        driver.setDataSource(getDataSource());
        driver.setConnectionInfo(this);
        return driver;
View Full Code Here

        catch (SQLException e) {
            logger.warning("While trying to load \"" + tableName +
                           "\" table, caught " +
                           e.getClass().getName() + ": " +
                           e.getMessage());
            throw new JDOFatalException(I18N.msg("E_jdo_sql_exception"), e);
        }
        finally {
            if (results != null) {
                try {
                    results.close();
View Full Code Here

            try {
                Document doc = biff.build(inputSource);
                Element root = doc.getRootElement();
                parseTables(root);
            } catch (JDOMException e) {
                throw new JDOFatalException(I18N.msg("E_parse_db_xml", databaseXML), e);
            } catch (IOException e) {
                throw new JDOFatalException(I18N.msg("E_parse_db_xml", databaseXML), e);
            }
        }
        else {
            // DATABASE_XML was not defined.
            usingDatabaseMetaData = true;
View Full Code Here

                JDOClass jdoClass = (JDOClass) i.next();
                parseClass(jdoClass, defaultPackage);
            }

        } catch (IOException e) {
            throw new JDOFatalException(I18N.msg("E_parse_jdo_xml"), e);
        } catch (ClassNotFoundException e) {
            throw new JDOFatalException(I18N.msg("E_jdo_xml_no_class", e.getMessage()));
        }
    }
View Full Code Here

            String value = (String) entry.getValue();
            if (key.equals("org.xorm.datastore.ConnectionInfoClass")) {
                try {
                    connectionInfoImpl = Class.forName(value);
                } catch (ClassNotFoundException e) {
                    throw new JDOFatalException(I18N.msg("E_no_connection_info_class", value));
                }
            } else if (key.equals("org.xorm.cache.DataCacheClass")) {
                if ("none".equals(value)) {
                    cacheImpl = null;
                } else {
                    try {
                        cacheImpl = Class.forName(value);
                    } catch (ClassNotFoundException e) {
                        throw new JDOFatalException(I18N.msg("E_no_cache_class", value));
                    }
                }
            } else if (key.equals("org.xorm.FetchGroupManagerClass")) {
                try {
                    fetchGroupManagerImpl = Class.forName(value);
                } catch (ClassNotFoundException e) {
                    throw new JDOFatalException(I18N.msg("E_no_cache_class", value));
                }
            } else if (key.equals("org.xorm.option.ThreadLocalTransactions")) {
                threadLocalTransactions = Boolean.valueOf(value).booleanValue();
            }
        }
View Full Code Here

            try {
                instance = (Configurable) configurableClass.newInstance();
                instance.setFactory(this);
                instance.setProperties(properties);
            } catch (InstantiationException e) {
                throw new JDOFatalException(I18N.msg("E_instantiation", configurableClass.getName()));
            } catch (IllegalAccessException e) {
                throw new JDOFatalException(I18N.msg("E_illegal_access", configurableClass.getName()));
            } catch (ClassCastException e) {
                throw new JDOFatalException(I18N.msg("E_not_configurable", configurableClass.getName()));
            }
        }
        return instance;
    }
View Full Code Here

    public ObjectId(String mangledId) {
  // De-mangle the ID
  int p = mangledId.indexOf(';');
  if (p == -1) {
      throw new JDOFatalException("Badly formatted object ID");
  }
  try {
      mappedClass = Class.forName(mangledId.substring(0,p));
  } catch (ClassNotFoundException e) {
      throw new JDOFatalException("Unknown object class " + mangledId.substring(0,p));
  }
  id = mangledId.substring(p+1);
    }
View Full Code Here

TOP

Related Classes of javax.jdo.JDOFatalException

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.