br.ufg.integrate.jdbc
Class StatementImpl

java.lang.Object
  extended by br.ufg.integrate.jdbc.StatementImpl
All Implemented Interfaces:
Constants, Statement, Wrapper
Direct Known Subclasses:
PreparedStatementImpl

public class StatementImpl
extends Object
implements Statement, Constants

Version:
0.1
Author:
Rogerio

Field Summary
protected  ConnectionImpl conn
           
 
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
Fields inherited from interface br.ufg.integrate.util.Constants
DB_MAJOR_VERSION, DB_MINOR_VERSION, DRIVER_CLASS, DRIVER_MAJOR_VERSION, DRIVER_MINOR_VERSION, DRIVER_NAME, DRIVER_RELEASE, INTEGRATE_CONFIG_FILE, JDBC_COMPLIANT, JDBC_MAJOR_VERSION, JDBC_MINOR_VERSION, PRODUCT_NAME, PRODUCT_RELEASE, URL_PREFIX
 
Constructor Summary
protected StatementImpl(ConnectionImpl con, Statement stm, Integration i)
          Create a new StatementImpl object.
 
Method Summary
 void addBatch(String sql)
          Implements method in interface java.sql.Statement
 void cancel()
          Implements method in interface java.sql.Statement
 void clearBatch()
          Implements method in interface java.sql.Statement
 void clearWarnings()
          Implements method in interface java.sql.Statement
 void close()
          Implements method in interface java.sql.Statement
 boolean execute(String sql)
          Implementa o método da interface java.sql.Statement.
 boolean execute(String sql, int autoGeneratedKeys)
          Implements method in interface java.sql.Statement
 boolean execute(String sql, int[] columnIndexes)
          Implements method in interface java.sql.Statement
 boolean execute(String sql, String[] columnNames)
          Implements method in interface java.sql.Statement
 int[] executeBatch()
          Implements method in interface java.sql.Statement
 ResultSet executeQuery(String sql)
          Implementa o método da interface java.sql.Statement.
 int executeUpdate(String sql)
          Implements method in interface java.sql.Statement
 int executeUpdate(String sql, int autoGeneratedKeys)
          Implements method in interface java.sql.Statement
 int executeUpdate(String sql, int[] columnIndexes)
          Implements method in interface java.sql.Statement
 int executeUpdate(String sql, String[] columnNames)
          Implements method in interface java.sql.Statement
 Connection getConnection()
          Implements method in interface java.sql.Statement
 int getFetchDirection()
          Implements method in interface java.sql.Statement
 int getFetchSize()
          Implements method in interface java.sql.Statement
 ResultSet getGeneratedKeys()
          Implements method in interface java.sql.Statement
 int getMaxFieldSize()
          Implements method in interface java.sql.Statement
 int getMaxRows()
          Implements method in interface java.sql.Statement
 boolean getMoreResults()
          Implementa o método da interface java.sql.Statement.
 boolean getMoreResults(int current)
          Implements method in interface java.sql.Statement
 int getQueryTimeout()
          Implements method in interface java.sql.Statement
 ResultSet getResultSet()
          Implements method in interface java.sql.Statement
 int getResultSetConcurrency()
          Implements method in interface java.sql.Statement
 int getResultSetHoldability()
          Implements method in interface java.sql.Statement
 int getResultSetType()
          Implements method in interface java.sql.Statement
 int getUpdateCount()
          Implementa o método da interface java.sql.Statement.
 SQLWarning getWarnings()
          Implements method in interface java.sql.Statement
 boolean isClosed()
          Implements method in interface java.sql.Statement
 boolean isPoolable()
          Implements method in interface java.sql.Statement
 boolean isWrapperFor(Class arg0)
          Implements method in interface java.sql.Statement
 void setCursorName(String name)
          Implements method in interface java.sql.Statement
 void setEscapeProcessing(boolean enable)
          Implements method in interface java.sql.Statement
 void setFetchDirection(int direction)
          Implements method in interface java.sql.Statement
 void setFetchSize(int rows)
          Implements method in interface java.sql.Statement
 void setMaxFieldSize(int max)
          Implements method in interface java.sql.Statement
 void setMaxRows(int max)
          Implements method in interface java.sql.Statement
 void setPoolable(boolean arg0)
          Implements method in interface java.sql.Statement
 void setQueryTimeout(int seconds)
          Implements method in interface java.sql.Statement
 Object unwrap(Class arg0)
          Implements method in interface java.sql.Statement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conn

protected ConnectionImpl conn
Constructor Detail

StatementImpl

protected StatementImpl(ConnectionImpl con,
                        Statement stm,
                        Integration i)
                 throws SQLException
Create a new StatementImpl object.

Throws:
SQLException
Method Detail

addBatch

public void addBatch(String sql)
              throws SQLException
Implements method in interface java.sql.Statement

Specified by:
addBatch in interface Statement
Throws:
SQLException
See Also:
Statement.addBatch(java.lang.String)

cancel

public void cancel()
            throws SQLException
Implements method in interface java.sql.Statement

Specified by:
cancel in interface Statement
Throws:
SQLException
See Also:
Statement.cancel()

clearBatch

public void clearBatch()
                throws SQLException
Implements method in interface java.sql.Statement

Specified by:
clearBatch in interface Statement
Throws:
SQLException
See Also:
Statement.clearBatch()

clearWarnings

public void clearWarnings()
                   throws SQLException
Implements method in interface java.sql.Statement

Specified by:
clearWarnings in interface Statement
Throws:
SQLException
See Also:
Statement.clearWarnings()

close

public void close()
           throws SQLException
Implements method in interface java.sql.Statement

Specified by:
close in interface Statement
Throws:
SQLException
See Also:
Statement.close()

execute

public boolean execute(String sql)
                throws SQLException
Implementa o método da interface java.sql.Statement. As sentenças SQL devem estar separadas por ';' para serem devidamente processadas. Como o Integrate só faz operações de consulta, se houver uma sentença diferente de SELECT, uma exceção é lançada. O retorno então será sempre true (caso não haja exceção), pois serão sempre ResultSet's (ver definição do método na API de JDBC). Os ResultSets retornados pelas sentenças são inseridos em uma coleção, que podem ser obtidos pelo método getMoreResults() e getResultSet().

Specified by:
execute in interface Statement
Throws:
SQLException
See Also:
Statement.execute(String), Statement.getMoreResults(), Statement.getResultSet()

execute

public boolean execute(String sql,
                       String[] columnNames)
                throws SQLException
Implements method in interface java.sql.Statement

Specified by:
execute in interface Statement
Throws:
SQLException
See Also:
Statement.execute(java.lang.String, java.lang.String[])

execute

public boolean execute(String sql,
                       int autoGeneratedKeys)
                throws SQLException
Implements method in interface java.sql.Statement

Specified by:
execute in interface Statement
Throws:
SQLException
See Also:
Statement.execute(java.lang.String)

execute

public boolean execute(String sql,
                       int[] columnIndexes)
                throws SQLException
Implements method in interface java.sql.Statement

Specified by:
execute in interface Statement
Throws:
SQLException
See Also:
Statement.execute(java.lang.String)

executeBatch

public int[] executeBatch()
                   throws SQLException
Implements method in interface java.sql.Statement

Specified by:
executeBatch in interface Statement
Throws:
SQLException
See Also:
Statement.executeBatch()

executeQuery

public ResultSet executeQuery(String sql)
                       throws SQLException
Implementa o método da interface java.sql.Statement. Repassa a sentença SQL para o Controlador do Integrate para que este solicite as subconsultas ao mediador e as repasse aos devidos tradutores. O resultado retornado pelo Controlador é um ResultSet que já contém todos os registros integrados, já no formato esperado pela aplicação cliente que disparou este método.

Specified by:
executeQuery in interface Statement
Throws:
SQLException
See Also:
Controller.executeIntegratedQuery(String, String), Statement.executeQuery(java.lang.String)

executeUpdate

public int executeUpdate(String sql)
                  throws SQLException
Implements method in interface java.sql.Statement

Specified by:
executeUpdate in interface Statement
Throws:
SQLException
See Also:
Statement.executeUpdate(java.lang.String)

executeUpdate

public int executeUpdate(String sql,
                         String[] columnNames)
                  throws SQLException
Implements method in interface java.sql.Statement

Specified by:
executeUpdate in interface Statement
Throws:
SQLException
See Also:
Statement.executeUpdate(java.lang.String)

executeUpdate

public int executeUpdate(String sql,
                         int autoGeneratedKeys)
                  throws SQLException
Implements method in interface java.sql.Statement

Specified by:
executeUpdate in interface Statement
Throws:
SQLException
See Also:
Statement.executeUpdate(java.lang.String)

executeUpdate

public int executeUpdate(String sql,
                         int[] columnIndexes)
                  throws SQLException
Implements method in interface java.sql.Statement

Specified by:
executeUpdate in interface Statement
Throws:
SQLException
See Also:
Statement.executeUpdate(java.lang.String)

getConnection

public Connection getConnection()
                         throws SQLException
Implements method in interface java.sql.Statement

Specified by:
getConnection in interface Statement
Throws:
SQLException
See Also:
Statement.getConnection()

getFetchDirection

public int getFetchDirection()
                      throws SQLException
Implements method in interface java.sql.Statement

Specified by:
getFetchDirection in interface Statement
Throws:
SQLException
See Also:
Statement.getFetchDirection()

getFetchSize

public int getFetchSize()
                 throws SQLException
Implements method in interface java.sql.Statement

Specified by:
getFetchSize in interface Statement
Throws:
SQLException
See Also:
Statement.getFetchSize()

getGeneratedKeys

public ResultSet getGeneratedKeys()
                           throws SQLException
Implements method in interface java.sql.Statement

Specified by:
getGeneratedKeys in interface Statement
Throws:
SQLException
See Also:
Statement.getGeneratedKeys()

getMaxFieldSize

public int getMaxFieldSize()
                    throws SQLException
Implements method in interface java.sql.Statement

Specified by:
getMaxFieldSize in interface Statement
Throws:
SQLException
See Also:
Statement.getMaxFieldSize()

getMaxRows

public int getMaxRows()
               throws SQLException
Implements method in interface java.sql.Statement

Specified by:
getMaxRows in interface Statement
Throws:
SQLException
See Also:
Statement.getMaxRows()

getMoreResults

public boolean getMoreResults()
                       throws SQLException
Implementa o método da interface java.sql.Statement. Como o Integrate só executa consultas, retorna 'true' enquanto houver ResultSet's na coleção.

Specified by:
getMoreResults in interface Statement
Throws:
SQLException
See Also:
Statement.getMoreResults().

getMoreResults

public boolean getMoreResults(int current)
                       throws SQLException
Implements method in interface java.sql.Statement

Specified by:
getMoreResults in interface Statement
Throws:
SQLException
See Also:
Statement.getMoreResults(), getMoreResults(int)

getQueryTimeout

public int getQueryTimeout()
                    throws SQLException
Implements method in interface java.sql.Statement

Specified by:
getQueryTimeout in interface Statement
Throws:
SQLException
See Also:
Statement.getQueryTimeout()

getResultSet

public ResultSet getResultSet()
                       throws SQLException
Implements method in interface java.sql.Statement

Specified by:
getResultSet in interface Statement
Throws:
SQLException
See Also:
Statement.getResultSet()

getResultSetConcurrency

public int getResultSetConcurrency()
                            throws SQLException
Implements method in interface java.sql.Statement

Specified by:
getResultSetConcurrency in interface Statement
Throws:
SQLException
See Also:
Statement.getResultSetConcurrency()

getResultSetHoldability

public int getResultSetHoldability()
                            throws SQLException
Implements method in interface java.sql.Statement

Specified by:
getResultSetHoldability in interface Statement
Throws:
SQLException
See Also:
Statement.getResultSetHoldability()

getResultSetType

public int getResultSetType()
                     throws SQLException
Implements method in interface java.sql.Statement

Specified by:
getResultSetType in interface Statement
Throws:
SQLException
See Also:
Statement.getResultSetType()

getUpdateCount

public int getUpdateCount()
                   throws SQLException
Implementa o método da interface java.sql.Statement. Como o Integrate só trabalha com consultas, este método nunca retornará a outro valor diferente de -1.

Specified by:
getUpdateCount in interface Statement
Throws:
SQLException
See Also:
Statement.getUpdateCount(), Statement.execute(String)

getWarnings

public SQLWarning getWarnings()
                       throws SQLException
Implements method in interface java.sql.Statement

Specified by:
getWarnings in interface Statement
Throws:
SQLException
See Also:
Statement.getWarnings()

isClosed

public boolean isClosed()
                 throws SQLException
Implements method in interface java.sql.Statement

Specified by:
isClosed in interface Statement
Throws:
SQLException
See Also:
Statement.isClosed()

isPoolable

public boolean isPoolable()
                   throws SQLException
Implements method in interface java.sql.Statement

Specified by:
isPoolable in interface Statement
Throws:
SQLException
See Also:
Statement.isPoolable()

isWrapperFor

public boolean isWrapperFor(Class arg0)
                     throws SQLException
Implements method in interface java.sql.Statement

Specified by:
isWrapperFor in interface Wrapper
Throws:
SQLException
See Also:
Wrapper.isWrapperFor(java.lang.Class)

setCursorName

public void setCursorName(String name)
                   throws SQLException
Implements method in interface java.sql.Statement

Specified by:
setCursorName in interface Statement
Throws:
SQLException
See Also:
Statement.setCursorName(java.lang.String)

setEscapeProcessing

public void setEscapeProcessing(boolean enable)
                         throws SQLException
Implements method in interface java.sql.Statement

Specified by:
setEscapeProcessing in interface Statement
Throws:
SQLException
See Also:
Statement.setEscapeProcessing(boolean)

setFetchDirection

public void setFetchDirection(int direction)
                       throws SQLException
Implements method in interface java.sql.Statement

Specified by:
setFetchDirection in interface Statement
Throws:
SQLException
See Also:
Statement.setFetchDirection(int)

setFetchSize

public void setFetchSize(int rows)
                  throws SQLException
Implements method in interface java.sql.Statement

Specified by:
setFetchSize in interface Statement
Throws:
SQLException
See Also:
Statement.setFetchSize(int)

setMaxFieldSize

public void setMaxFieldSize(int max)
                     throws SQLException
Implements method in interface java.sql.Statement

Specified by:
setMaxFieldSize in interface Statement
Throws:
SQLException
See Also:
Statement.setMaxFieldSize(int)

setMaxRows

public void setMaxRows(int max)
                throws SQLException
Implements method in interface java.sql.Statement

Specified by:
setMaxRows in interface Statement
Throws:
SQLException
See Also:
Statement.setMaxRows(int)

setQueryTimeout

public void setQueryTimeout(int seconds)
                     throws SQLException
Implements method in interface java.sql.Statement

Specified by:
setQueryTimeout in interface Statement
Throws:
SQLException
See Also:
Statement.setQueryTimeout(int)

setPoolable

public void setPoolable(boolean arg0)
                 throws SQLException
Implements method in interface java.sql.Statement

Specified by:
setPoolable in interface Statement
Throws:
SQLException
See Also:
Statement.setPoolable(boolean)

unwrap

public Object unwrap(Class arg0)
              throws SQLException
Implements method in interface java.sql.Statement

Specified by:
unwrap in interface Wrapper
Throws:
SQLException
See Also:
Wrapper.unwrap(java.lang.Class)


Copyright © 2008 Rogério Arantes Gaioso. All Rights Reserved.