org.opensubsystems.core.persist.db.maxdb
Class MaxDBDataUtils

java.lang.Object
  extended by org.opensubsystems.core.persist.db.maxdb.MaxDBDataUtils

public final class MaxDBDataUtils
extends java.lang.Object

This class collects code fragments which are reusable for managing data objects in MaxDB. Since MaxDB is rebranded SAP DB database, at this time it can reuse majority of the SAP DB functionality.

Version:
$Id: MaxDBDataUtils.java,v 1.2 2007/01/07 06:14:38 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
Initial revision

Method Summary
static void insertAndFetchGeneratedValues(java.sql.CallableStatement insertStatement, int iIndex, BasicDataObject data)
          Insert the data, fetch from the database id and generated creation and modification timestamps for the newly created data object.
static void updateAndFetchGeneratedValues(java.sql.CallableStatement updateStatement, int iIndex, ModifiableDataObject data)
          Update the data, fetch from the database id and generated modification timestamps for the newly created data object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

insertAndFetchGeneratedValues

public static void insertAndFetchGeneratedValues(java.sql.CallableStatement insertStatement,
                                                 int iIndex,
                                                 BasicDataObject data)
                                          throws java.sql.SQLException,
                                                 OSSException
Insert the data, fetch from the database id and generated creation and modification timestamps for the newly created data object. Note: Since the caller created the callable statement, the caller is responsible for its closing.

Parameters:
insertStatement - - statement used to insert the data
iIndex - - index of the ID OUT parameter of the stored procedure
data - - data object to insert
Throws:
java.sql.SQLException - - an error has occured
OSSException - - an error has occured

updateAndFetchGeneratedValues

public static void updateAndFetchGeneratedValues(java.sql.CallableStatement updateStatement,
                                                 int iIndex,
                                                 ModifiableDataObject data)
                                          throws java.sql.SQLException,
                                                 OSSException
Update the data, fetch from the database id and generated modification timestamps for the newly created data object. Note: Since the caller created the callable statement, the caller is responsible for its closing.

Parameters:
updateStatement - - statement used to update the data
iIndex - - index of the MODIFIED_TIMESTAMP OUT parameter of the stored procedure
data - - data object to update
Throws:
java.sql.SQLException - - an error has occured
OSSException - - an error has occured


Copyright © 2003 - 2006 OpenSubsystems s.r.o.