org.opensubsystems.core.persist.db.mssql
Class MSSQLDataUtils

java.lang.Object
  extended by org.opensubsystems.core.persist.db.mssql.MSSQLDataUtils

public final class MSSQLDataUtils
extends java.lang.Object

This class collects code fragments which are reusable for managing data objects in MS SQL Server 2000.

Version:
$Id: MSSQLDataUtils.java,v 1.3 2007/01/07 06:14:54 bastafidli Exp $
Author:
Julo Legeny
Code reviewer:
Miro Halas
Code reviewed:
1.1 2005/08/20 21:17:02 bastafidli

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.