Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.mdm.index.ops
Class ObjectPersistenceService

    java.lang.Object
      com.sun.mdm.index.ops.ObjectPersistenceService

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  EnterpriseDB, KeyStatisticsReportDB, MergeObjectDB, SBROverWriteDB, SystemObjectDB, SystemSBRDB, TransactionObjectDB

public class ObjectPersistenceService
extends java.lang.Object
implements java.io.Serializable

See Also:
  Serialized Form

Field Summary
`(package private) static java.lang.String` | `DATEFORMAT`
`(package private) static java.lang.String` | `DBDATEFORMAT`

Constructor Summary
`ObjectPersistenceService()` Default constructor: jdbc connection is obtained here (future enhancements to be done for performance

Method Summary
`(package private) static java.util.ArrayList` | `addobject(java.util.ArrayList list, boolean b)` Adds boolean data to an ArrayList
`(package private) static java.util.ArrayList` | `addobject(java.util.ArrayList list, byte b)` adds byte data to an ArrayList
`(package private) static java.util.ArrayList` | `addobject(java.util.ArrayList list, double d)` adds double data to an ArrayList
`(package private) static java.util.ArrayList` | `addobject(java.util.ArrayList list, float f)` Adds float data to an ArrayList
`(package private) static java.util.ArrayList` | `addobject(java.util.ArrayList list, int i)` Adds int data to an ArrayList
`(package private) static java.util.ArrayList` | `addobject(java.util.ArrayList list, java.lang.Object o)` adds an Object to an ArrayList
`void` | `finalize()` Finalizer.
`java.sql.PreparedStatement` | `getStatement(java.lang.String sqlstr, java.sql.Connection conn)` Gets a PreparedStatement from an SQL statement.
`java.lang.Object` | `getValue(java.sql.ResultSet rs, java.lang.String column, java.lang.String type)` Gets value from a ResultSet by Column name and type.
`void` | `init()` Initialization.
`protected static void` | `log(java.lang.String msg)` Message logger.
`void` | `setParam(java.sql.PreparedStatement stmt, int pos, java.lang.String type, java.lang.Object value)` Binds parameters to a PreparedStatement by position and type.
`void` | `setParamBlob(java.sql.PreparedStatement ps, int columnIndex, java.lang.Object value)` Sets a blob value by PreparedStatement and Column index
`void` | `setParamBlob(java.sql.ResultSet rs, java.lang.String column, java.lang.Object value)` Sets a blob value by ResultSet and Column name.
`static java.lang.String` | `sql2str(java.lang.String err, java.util.ArrayList list)` Generates a SQL Statement string from its template and parameter list.
`(package private) static java.lang.String` | `strfmt(java.lang.String str)` Formats a String for output by checking the length.

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DATEFORMAT

    static final java.lang.String DATEFORMAT

See Also:
  Constant Field Values

### DBDATEFORMAT

    static final java.lang.String DBDATEFORMAT

See Also:
  Constant Field Values

Constructor Detail

### ObjectPersistenceService

    public ObjectPersistenceService()
                             throws OPSException

  Default constructor: jdbc connection is obtained here (future enhancements to be done for performance

  Throws:
    `OPSException` - if an error occurs.

Method Detail

### addobject

    static java.util.ArrayList addobject(java.util.ArrayList list,
                                         boolean b)

  Adds boolean data to an ArrayList

  Parameters:
    `list` - ArrayList to be updated.
  Returns:
    updated ArrayList

### addobject

    static java.util.ArrayList addobject(java.util.ArrayList list,
                                         byte b)

  adds byte data to an ArrayList

  Parameters:
    `list` - ArrayList to be updated.
    `b` -
  Returns:
    updated ArrayList

### addobject

    static java.util.ArrayList addobject(java.util.ArrayList list,
                                         double d)

  adds double data to an ArrayList

  Parameters:
    `list` - ArrayList to be updated.
    `d` - Value to be added.
  Returns:
    updated ArrayList

### addobject

    static java.util.ArrayList addobject(java.util.ArrayList list,
                                         float f)

  Adds float data to an ArrayList

  Parameters:
    `list` - ArrayList to be updated.
  Returns:
    updated ArrayList

### addobject

    static java.util.ArrayList addobject(java.util.ArrayList list,
                                         int i)

  Adds int data to an ArrayList

  Parameters:
    `list` - ArrayList to be updated.
    `i` - Value to be added.
  Returns:
    updated ArrayList

### addobject

    static java.util.ArrayList addobject(java.util.ArrayList list,
                                         java.lang.Object o)

  adds an Object to an ArrayList

  Parameters:
    `list` - ArrayList to be updated.
    `o` - Value to be added.
  Returns:
    updated ArrayList

### finalize

    public void finalize()

  Finalizer.

### getStatement

    public java.sql.PreparedStatement getStatement(java.lang.String sqlstr,
                                                   java.sql.Connection conn)
                                            throws OPSException

  Gets a PreparedStatement from an SQL statement.

  Parameters:
    `sqlstr` - SQL statement.
    `conn` - JDBC connection.
  Returns:
    PreparedStatement
  Throws:
    `OPSException` - if an error occurs.

### getValue

    public java.lang.Object getValue(java.sql.ResultSet rs,
                                     java.lang.String column,
                                     java.lang.String type)
                              throws OPSException

  Gets value from a ResultSet by Column name and type.

  Parameters:
    `rs` - ResultSet.
    `column` - Column name.
    `type` - Column type.
  Returns:
    Object containing the column value from the ResultSet.
  Throws:
    `OPSException` - if an error occurs.

### init

    public void init()
              throws OPSException

  Initialization.

  Throws:
    `OPSException` - if an error occurs.

### log

    protected static void log(java.lang.String msg)

  Message logger.

  Parameters:
    `msg` - Message to log.

### setParam

    public void setParam(java.sql.PreparedStatement stmt,
                         int pos,
                         java.lang.String type,
                         java.lang.Object value)
                  throws OPSException

  Binds parameters to a PreparedStatement by position and type.

  Parameters:
    `stmt` - PreparedStatement handle.
    `pos` - PreparedStatement parameter index position.
    `type` - Type of the parameter.
    `value` - The parameter to be bounded.
  Throws:
    `OPSException` - if an error is encountered.

### setParamBlob

    public void setParamBlob(java.sql.PreparedStatement ps,
                             int columnIndex,
                             java.lang.Object value)
                      throws OPSException

  Sets a blob value by PreparedStatement and Column index

  Parameters:
    `value` - The value to be set.
  Throws:
    `OPSException` - if an error is encountered.

### setParamBlob

    public void setParamBlob(java.sql.ResultSet rs,
                             java.lang.String column,
                             java.lang.Object value)
                      throws OPSException

  Sets a blob value by ResultSet and Column name.

  Parameters:
    `rs` - ResultSet.
    `column` - Column name.
    `value` - The value to be set.
  Throws:
    `OPSException` - if an error is encountered.

### sql2str

    public static java.lang.String sql2str(java.lang.String err,
                                           java.util.ArrayList list)

  Generates a SQL Statement string from its template and parameter list.

  Parameters:
    `err` - SQL statement template string.
  Returns:
    SQL String.

### strfmt

    static java.lang.String strfmt(java.lang.String str)

  Formats a String for output by checking the length.

  Parameters:
    `str` - String to format.
  Returns:
    String formatted string.

Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Sun Microsystems, Inc.