org.exolab.castor.jdo.drivers

Class InstantDBFactory

Implemented Interfaces:
PersistenceFactory

public class InstantDBFactory
extends GenericFactory

Persistence factory for InstantDB database (http://instantdb.enhydra.org/ ).

Example database.xml file for JDO

   <database name="test" engine="instantdb" >
       <driver class-name="org.enhydra.instantdb.jdbc.idbDriver" 
               url="jdbc:idb:C:\\castor-0.8.8\\db\\test\\test.prp">
         <param name="user" value="" />
         <param name="password" value="" />
       </driver>
       <mapping href="mapping.xml" />
    </database>
  
Version:
1.0
Author:
I. Burak Ozyurt

Method Summary

Class
adjustSqlType(Class sqlType)
For NUMERIC type ResultSet.getObject() returns Double instead of BigDecimal for InstantDB.
PersistenceQuery
getCallQuery(String call, Class[] paramTypes, Class javaClass, String[] fields, int[] sqlTypes)
Needed to process OQL queries of "CALL" type (using stored procedure call).
String
getFactoryName()
QueryExpression
getQueryExpression()
Boolean
isDuplicateKeyException(Exception except)
Determine if the given SQLException is DuplicateKeyException

Methods inherited from class org.exolab.castor.jdo.drivers.GenericFactory

doubleQuoteName, getFactoryName, getQueryExpression, isDuplicateKeyException, quoteName

Methods inherited from class org.exolab.castor.jdo.engine.BaseFactory

adjustSqlType, getCallQuery, getPersistence, supportsSetNullInWhere

Method Details

adjustSqlType

public Class adjustSqlType(Class sqlType)
For NUMERIC type ResultSet.getObject() returns Double instead of BigDecimal for InstantDB.
Overrides:
adjustSqlType in interface BaseFactory

getCallQuery

public PersistenceQuery getCallQuery(String call,
                                     Class[] paramTypes,
                                     Class javaClass,
                                     String[] fields,
                                     int[] sqlTypes)
Needed to process OQL queries of "CALL" type (using stored procedure call). This feature is specific for JDO.
Overrides:
getCallQuery in interface BaseFactory
Parameters:
call - Stored procedure call (without "{call")
paramTypes - The types of the query parameters
javaClass - The Java class of the query results
fields - The field names
sqlTypes - The field SQL types
Returns:
null if this feature is not supported.

getFactoryName

public String getFactoryName()
Specified by:
getFactoryName in interface PersistenceFactory
Overrides:
getFactoryName in interface GenericFactory

getQueryExpression

public QueryExpression getQueryExpression()
Specified by:
getQueryExpression in interface PersistenceFactory
Overrides:
getQueryExpression in interface GenericFactory

isDuplicateKeyException

public Boolean isDuplicateKeyException(Exception except)
Determine if the given SQLException is DuplicateKeyException
Specified by:
isDuplicateKeyException in interface PersistenceFactory
Overrides:
isDuplicateKeyException in interface GenericFactory
Returns:
Boolean.TRUE means "yes", Boolean.FALSE means "no", null means "cannot determine"

Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com