org.ow2.petals.bc.sql.service
Class SQLService

java.lang.Object
  extended by org.ow2.petals.bc.sql.service.SQLService

public class SQLService
extends java.lang.Object

Author:
alouis

Constructor Summary
SQLService(java.util.logging.Logger logger)
           
 
Method Summary
 void resultSetAsXMLOutputStream(java.sql.ResultSet resultSet, java.io.OutputStream outputStream, boolean showAttributes)
          Transform the given resultSet as an XML outputStream
 java.sql.ResultSet select(java.lang.String sql, java.sql.Connection connection)
          Execute the select SQL command on the given connection.
 void sqlParametersAsXMLOutputStream(java.util.List<SQLParameter> sqlParameters, java.io.OutputStream outputStream, boolean isResultXML)
          Inject the given list of SQL parameters into a XML outputStream.
 void storedProcedure(java.util.List<SQLParameter> sqlParameters, java.lang.String call, java.sql.Connection connection)
          Execute the SQL Stored Procedure on the given connection.
 int update(java.lang.String sql, java.sql.Connection connection)
          Execute the update SQL command on the given connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLService

public SQLService(java.util.logging.Logger logger)
Method Detail

select

public java.sql.ResultSet select(java.lang.String sql,
                                 java.sql.Connection connection)
                          throws java.sql.SQLException
Execute the select SQL command on the given connection.

Parameters:
sql -
connection -
Returns:
Throws:
java.sql.SQLException

storedProcedure

public void storedProcedure(java.util.List<SQLParameter> sqlParameters,
                            java.lang.String call,
                            java.sql.Connection connection)
                     throws java.sql.SQLException,
                            java.text.ParseException,
                            javax.jbi.messaging.MessagingException,
                            java.io.IOException
Execute the SQL Stored Procedure on the given connection.

Parameters:
sql -
connection -
Throws:
java.sql.SQLException
java.text.ParseException
javax.jbi.messaging.MessagingException
java.io.IOException

update

public int update(java.lang.String sql,
                  java.sql.Connection connection)
           throws java.sql.SQLException
Execute the update SQL command on the given connection.

Parameters:
sql -
connection -
Returns:
Throws:
java.sql.SQLException

resultSetAsXMLOutputStream

public void resultSetAsXMLOutputStream(java.sql.ResultSet resultSet,
                                       java.io.OutputStream outputStream,
                                       boolean showAttributes)
                                throws java.sql.SQLException,
                                       javax.xml.stream.XMLStreamException
Transform the given resultSet as an XML outputStream

Parameters:
resultSet - the jdbc resultSet to transform
outputStream - the stream where the XML is written
showAttributes - row index, column name and type are set as xml attributes in the response
Throws:
java.sql.SQLException
javax.xml.stream.XMLStreamException

sqlParametersAsXMLOutputStream

public void sqlParametersAsXMLOutputStream(java.util.List<SQLParameter> sqlParameters,
                                           java.io.OutputStream outputStream,
                                           boolean isResultXML)
                                    throws javax.xml.stream.XMLStreamException,
                                           java.io.IOException
Inject the given list of SQL parameters into a XML outputStream.

Parameters:
sqlParameters - the list of SQL parameters from the Stored Statement
outputStream - the stream where the XML is written
isResultXML - if true,
Throws:
javax.xml.stream.XMLStreamException
java.io.IOException


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.