cgl.narada.wsinfra.wsrm.storage.impl
Class WsrmQueryHandler

java.lang.Object
  extended by cgl.narada.wsinfra.wsrm.storage.impl.WsrmQueryHandler

public class WsrmQueryHandler
extends Object

Title: WsrmQueryHandler

Description: Helps to processes that needs to access and store data to the database


Constructor Summary
WsrmQueryHandler(Connection _connection)
           
 
Method Summary
 void closePreparedStatement(PreparedStatement preparedStatement)
          closes the result set objects
 void closeResultSet(ResultSet resultSet)
          closes the result set objects
 long getAndIncrementExchangeNumber()
          creates an exchange number by getting the previous one from database and increment it by 1.
 boolean getBooleanOfInt(int value)
          converts integers into boolean values
 long getExchangeNumber()
          returns exchange number that is a long number
 int getIntOfBoolean(boolean value)
          to help database insertion of boolean values this method convert them into integer format
 long getLongNumber(String query)
          returs the value of count that is provided by query the count is maching row numbers query may be : "select count(*) from tablename "
 long[] getLongNumbers(ResultSet resultSet)
          returns the long values of maching results in an array such as message numbers
 PreparedStatement getPreparedStatement(String sqlQuery)
          executes sql query and returns PreparedStatement
 ResultSet getResultSet(PreparedStatement preparedStatement)
          executes sql query and returns result set
 String[] getStringArray(ResultSet resultSet)
          returns the strings of maching results in an array such as sequence numbers
 boolean isExistInTable(String query)
          checks whether the parameter exists in the table
static void main(String[] args)
           
 void setExchangeNumber(long exchangeNumber)
          inserts the exchange number into database
 int updateQuery(String sqlQuery)
          Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement and returns number of rows that are effected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WsrmQueryHandler

public WsrmQueryHandler(Connection _connection)
Method Detail

getPreparedStatement

public PreparedStatement getPreparedStatement(String sqlQuery)
                                       throws WsrmStorageException
executes sql query and returns PreparedStatement

Throws:
WsrmStorageException

closePreparedStatement

public void closePreparedStatement(PreparedStatement preparedStatement)
                            throws WsrmStorageException
closes the result set objects

Throws:
WsrmStorageException

getResultSet

public ResultSet getResultSet(PreparedStatement preparedStatement)
                       throws WsrmStorageException
executes sql query and returns result set

Throws:
WsrmStorageException

closeResultSet

public void closeResultSet(ResultSet resultSet)
                    throws WsrmStorageException
closes the result set objects

Throws:
WsrmStorageException

updateQuery

public int updateQuery(String sqlQuery)
                throws WsrmStorageException
Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement and returns number of rows that are effected

Throws:
WsrmStorageException

getLongNumber

public long getLongNumber(String query)
                   throws WsrmStorageException
returs the value of count that is provided by query the count is maching row numbers query may be : "select count(*) from tablename "

Throws:
WsrmStorageException

getLongNumbers

public long[] getLongNumbers(ResultSet resultSet)
                      throws WsrmStorageException
returns the long values of maching results in an array such as message numbers

Throws:
WsrmStorageException

getStringArray

public String[] getStringArray(ResultSet resultSet)
                        throws WsrmStorageException
returns the strings of maching results in an array such as sequence numbers

Throws:
WsrmStorageException

isExistInTable

public boolean isExistInTable(String query)
                       throws WsrmStorageException
checks whether the parameter exists in the table

Throws:
WsrmStorageException

getExchangeNumber

public long getExchangeNumber()
                       throws WsrmStorageException
returns exchange number that is a long number

Throws:
WsrmStorageException

setExchangeNumber

public void setExchangeNumber(long exchangeNumber)
                       throws WsrmStorageException
inserts the exchange number into database

Throws:
WsrmStorageException

getAndIncrementExchangeNumber

public long getAndIncrementExchangeNumber()
                                   throws WsrmStorageException
creates an exchange number by getting the previous one from database and increment it by 1.

Throws:
WsrmStorageException

getIntOfBoolean

public int getIntOfBoolean(boolean value)
to help database insertion of boolean values this method convert them into integer format


getBooleanOfInt

public boolean getBooleanOfInt(int value)
converts integers into boolean values


main

public static void main(String[] args)


For comments and suggestions please send e-mail to The NaradaBrokering Project