palio.connectors
Class SQLConnector

java.lang.Object
  extended by palio.connectors.Connector
      extended by palio.connectors.PooledConnector
          extended by palio.connectors.SQLConnector
All Implemented Interfaces:
DedicatedConnectionSupport, SQLConnectable, SQLConnectableExt
Direct Known Subclasses:
HibernateConnector, SQLPalioConnector

public abstract class SQLConnector
extends PooledConnector
implements SQLConnectableExt

A Class SQLConnector.
Method Object newConnection() should return Object[], where
[0] - should be Connection
[1] - should be Statement
[2] - should be Statement for extended queries

Author:
Krzysztof Synowiec

Nested Class Summary
 
Nested classes/interfaces inherited from interface palio.connectors.SQLConnectable
SQLConnectable.QueryReader
 
Field Summary
 
Fields inherited from interface palio.connectors.SQLConnectable
DB2, GENERIC, HIBERNATE, HSQL, MSSQL, MYSQL, ORACLE, PALIO, POSTGRESQL, SYBASE
 
Constructor Summary
SQLConnector(java.lang.String url, java.util.Properties properties)
           
 
Method Summary
 void commit()
           
 void debugInit()
           
static void debugSave(java.lang.String query, java.lang.Object[] params, long start, long count, int resultCount, long startTime, java.lang.String option)
           
 void dedicatedCommit()
           
 void dedicatedRollback()
           
 void dedicatedStart()
           
 void dedicatedStop()
           
 java.lang.Object executeFunction(java.lang.String query, java.lang.Object[] params, java.lang.String outType)
           
 java.lang.Object[] executePL_SQL(java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams)
           
 java.lang.Object[] executeProcedure(java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypesParams)
           
 int fastRead(SQLConnectable.QueryReader reader, java.lang.String query, java.lang.Object... params)
           
static java.util.Map<java.lang.Integer,java.lang.String> getConnectorTypes()
           
 java.lang.Object[] getInfo()
           
 java.sql.DatabaseMetaData getMetaData()
           
static java.lang.String getOutTypeParamForClass(java.lang.Class clazz)
           
 java.sql.ResultSet getResultSet()
           
 java.sql.ResultSetMetaData getResultSetMetaData()
           
 java.lang.String info()
           
 void init()
           
 boolean isNoTransaction()
           
 boolean isTransaction()
           
 int read(SQLConnectable.QueryReader reader, java.lang.String query, java.lang.Object... params)
           
 java.util.LinkedList read(java.lang.String query)
           
 void read(java.lang.String query, groovy.lang.Closure code)
           
 palio.connectors.SQLQueryResult read(java.lang.String query, long start, int count)
           
 void read(java.lang.String query, java.lang.Long start, java.lang.Integer count, groovy.lang.Closure code)
          Deprecated. 
 java.util.LinkedList read(java.lang.String query, java.lang.Long start, java.lang.Integer count, java.lang.String paramNameRowCount)
          Deprecated. 
 java.util.LinkedList read(java.lang.String query, java.lang.Object[] params)
           
 void read(java.lang.String query, java.lang.Object[] params, groovy.lang.Closure code)
           
 void read(java.lang.String query, java.lang.Object[] params, java.lang.Long start, java.lang.Integer count, groovy.lang.Closure code)
          Deprecated. 
 java.util.LinkedList read(java.lang.String query, java.lang.Object[] params, java.lang.Long start, java.lang.Integer count, java.lang.String paramNameRowCount)
          Deprecated. 
 java.util.LinkedList read(java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams)
           
 void read(java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams, groovy.lang.Closure code)
           
 void read(java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams, long start, int count, groovy.lang.Closure code)
           
 java.util.LinkedList read(java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams, java.lang.Long start, java.lang.Integer count, java.lang.String paramNameRowCount)
          Deprecated. 
 java.util.LinkedList read(java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams, long start, int count, java.lang.String paramNameRowCount)
           
 void read(java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams, java.lang.Long start, java.lang.Long count, groovy.lang.Closure code)
           
 java.util.LinkedList read(java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams, java.lang.Long start, java.lang.Long count, java.lang.String paramNameRowCount)
           
 void read(java.lang.String rowParamName, java.lang.String query, java.lang.Long start, java.lang.Integer count, palio.compiler.PalioCode code)
          Deprecated. 
 void read(java.lang.String rowParamName, java.lang.String query, java.lang.Object[] params, java.lang.Long start, java.lang.Integer count, palio.compiler.PalioCode code)
          Deprecated. 
 void read(java.lang.String rowParamName, java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams, long start, int count, palio.compiler.PalioCode code)
           
 void read(java.lang.String rowParamName, java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams, java.lang.Long start, java.lang.Long count, palio.compiler.PalioCode code)
           
 void read(java.lang.String rowParamName, java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams, palio.compiler.PalioCode code)
           
 void read(java.lang.String rowParamName, java.lang.String query, java.lang.Object[] params, palio.compiler.PalioCode code)
           
 void read(java.lang.String rowParamName, java.lang.String query, palio.compiler.PalioCode code)
           
 java.util.LinkedList readAsMaps(java.lang.String query)
           
 java.util.LinkedList readAsMaps(java.lang.String query, java.lang.Long start, java.lang.Integer count, java.lang.String paramNameRowCount)
          Deprecated. 
 java.util.LinkedList readAsMaps(java.lang.String query, java.lang.Object[] params)
           
 java.util.LinkedList readAsMaps(java.lang.String query, java.lang.Object[] params, java.lang.Long start, java.lang.Integer count, java.lang.String paramNameRowCount)
          Deprecated. 
 java.util.LinkedList readAsMaps(java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams)
           
 java.util.LinkedList readAsMaps(java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams, java.lang.Long start, java.lang.Integer count, java.lang.String paramNameRowCount)
           
 java.util.LinkedList readAsMaps(java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams, java.lang.Long start, java.lang.Long count, java.lang.String paramNameRowCount)
           
 java.lang.Object[] readLine(java.lang.String query)
           
 java.lang.Object[] readLine(java.lang.String query, java.lang.Object[] params)
           
 java.lang.Object[] readLine(java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams)
           
 java.util.HashMap readLineAsMap(java.lang.String query)
           
 java.util.HashMap readLineAsMap(java.lang.String query, java.lang.Object[] params)
           
 java.util.HashMap readLineAsMap(java.lang.String query, java.lang.Object[] params, java.lang.Object[] outTypeParams)
           
 void rollback()
           
 void transactionStart()
           
 void transactionStop()
           
 java.lang.Integer[] write(java.lang.Object[] queries)
           
 java.lang.Integer write(java.lang.String query)
           
 java.lang.Integer write(java.lang.String query, java.lang.Object[] params)
           
 void writeLob(java.lang.String selectLob, java.lang.Object body)
           
 void writeLob(java.lang.String selectLob, java.lang.Object[] params, java.lang.Object body)
           
 
Methods inherited from class palio.connectors.PooledConnector
BusyChecker, clearThreadResources, close, DedicateChecker, FreeChecker, refresh
 
Methods inherited from class palio.connectors.Connector
getConnector, getInstance, getName, getUrl, init, setDedicatedLogConfiguration, setInstance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface palio.connectors.SQLConnectable
getName, getSequence, getType, getUrl, needWriteLob
 

Constructor Detail

SQLConnector

public SQLConnector(java.lang.String url,
                    java.util.Properties properties)
Method Detail

getConnectorTypes

public static java.util.Map<java.lang.Integer,java.lang.String> getConnectorTypes()

init

public void init()
          throws palio.PalioException
Overrides:
init in class PooledConnector
Throws:
palio.PalioException

debugInit

public void debugInit()

debugSave

public static void debugSave(java.lang.String query,
                             java.lang.Object[] params,
                             long start,
                             long count,
                             int resultCount,
                             long startTime,
                             java.lang.String option)

getOutTypeParamForClass

public static java.lang.String getOutTypeParamForClass(java.lang.Class clazz)

read

public java.util.LinkedList read(java.lang.String query,
                                 java.lang.Object[] params,
                                 java.lang.Object[] outTypeParams,
                                 java.lang.Long start,
                                 java.lang.Long count,
                                 java.lang.String paramNameRowCount)
                          throws palio.PalioException
Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

public java.util.LinkedList read(java.lang.String query,
                                 java.lang.Object[] params,
                                 java.lang.Object[] outTypeParams,
                                 long start,
                                 int count,
                                 java.lang.String paramNameRowCount)
                          throws palio.PalioException
Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

readAsMaps

public java.util.LinkedList readAsMaps(java.lang.String query,
                                       java.lang.Object[] params,
                                       java.lang.Object[] outTypeParams,
                                       java.lang.Long start,
                                       java.lang.Long count,
                                       java.lang.String paramNameRowCount)
                                throws palio.PalioException
Specified by:
readAsMaps in interface SQLConnectable
Throws:
palio.PalioException

readLine

public final java.lang.Object[] readLine(java.lang.String query,
                                         java.lang.Object[] params,
                                         java.lang.Object[] outTypeParams)
                                  throws palio.PalioException
Specified by:
readLine in interface SQLConnectable
Throws:
palio.PalioException

readLineAsMap

public final java.util.HashMap readLineAsMap(java.lang.String query,
                                             java.lang.Object[] params,
                                             java.lang.Object[] outTypeParams)
                                      throws palio.PalioException
Specified by:
readLineAsMap in interface SQLConnectable
Throws:
palio.PalioException

read

public final palio.connectors.SQLQueryResult read(java.lang.String query,
                                                  long start,
                                                  int count)
                                           throws palio.PalioException
Throws:
palio.PalioException

read

public final int read(SQLConnectable.QueryReader reader,
                      java.lang.String query,
                      java.lang.Object... params)
               throws palio.PalioException
Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

fastRead

public final int fastRead(SQLConnectable.QueryReader reader,
                          java.lang.String query,
                          java.lang.Object... params)
                   throws palio.PalioException
Specified by:
fastRead in interface SQLConnectable
Throws:
palio.PalioException

read

public final void read(java.lang.String rowParamName,
                       java.lang.String query,
                       java.lang.Object[] params,
                       java.lang.Object[] outTypeParams,
                       java.lang.Long start,
                       java.lang.Long count,
                       palio.compiler.PalioCode code)
                throws palio.PalioException
Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

public final void read(java.lang.String rowParamName,
                       java.lang.String query,
                       java.lang.Object[] params,
                       java.lang.Object[] outTypeParams,
                       long start,
                       int count,
                       palio.compiler.PalioCode code)
                throws palio.PalioException
Throws:
palio.PalioException

read

public final void read(java.lang.String query,
                       java.lang.Object[] params,
                       java.lang.Object[] outTypeParams,
                       java.lang.Long start,
                       java.lang.Long count,
                       groovy.lang.Closure code)
                throws palio.PalioException
Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

public final void read(java.lang.String query,
                       java.lang.Object[] params,
                       java.lang.Object[] outTypeParams,
                       long start,
                       int count,
                       groovy.lang.Closure code)
                throws palio.PalioException
Throws:
palio.PalioException

write

public final java.lang.Integer write(java.lang.String query)
                              throws palio.PalioException
Specified by:
write in interface SQLConnectable
Throws:
palio.PalioException

write

public final java.lang.Integer write(java.lang.String query,
                                     java.lang.Object[] params)
                              throws palio.PalioException
Specified by:
write in interface SQLConnectable
Throws:
palio.PalioException

write

public final java.lang.Integer[] write(java.lang.Object[] queries)
                                throws palio.PalioException
Specified by:
write in interface SQLConnectable
Throws:
palio.PalioException

executePL_SQL

public final java.lang.Object[] executePL_SQL(java.lang.String query,
                                              java.lang.Object[] params,
                                              java.lang.Object[] outTypeParams)
                                       throws palio.PalioException
Specified by:
executePL_SQL in interface SQLConnectable
Throws:
palio.PalioException

executeFunction

public final java.lang.Object executeFunction(java.lang.String query,
                                              java.lang.Object[] params,
                                              java.lang.String outType)
                                       throws palio.PalioException
Specified by:
executeFunction in interface SQLConnectable
Throws:
palio.PalioException

executeProcedure

public final java.lang.Object[] executeProcedure(java.lang.String query,
                                                 java.lang.Object[] params,
                                                 java.lang.Object[] outTypesParams)
                                          throws palio.PalioException
Specified by:
executeProcedure in interface SQLConnectable
Throws:
palio.PalioException

dedicatedStart

public final void dedicatedStart()
                          throws palio.PalioException
Specified by:
dedicatedStart in interface DedicatedConnectionSupport
Throws:
palio.PalioException

dedicatedStop

public final void dedicatedStop()
Specified by:
dedicatedStop in interface DedicatedConnectionSupport

dedicatedCommit

public void dedicatedCommit()
                     throws palio.PalioException
Specified by:
dedicatedCommit in interface DedicatedConnectionSupport
Throws:
palio.PalioException

dedicatedRollback

public void dedicatedRollback()
Specified by:
dedicatedRollback in interface DedicatedConnectionSupport

transactionStart

public final void transactionStart()
                            throws palio.PalioException
Specified by:
transactionStart in interface SQLConnectable
Throws:
palio.PalioException

transactionStop

public final void transactionStop()
                           throws palio.PalioException
Specified by:
transactionStop in interface SQLConnectable
Throws:
palio.PalioException

commit

public void commit()
            throws palio.PalioException
Specified by:
commit in interface SQLConnectable
Throws:
palio.PalioException

rollback

public void rollback()
              throws palio.PalioException
Specified by:
rollback in interface SQLConnectable
Throws:
palio.PalioException

isTransaction

public boolean isTransaction()
Specified by:
isTransaction in interface DedicatedConnectionSupport
Specified by:
isTransaction in interface SQLConnectable

isNoTransaction

public boolean isNoTransaction()
Specified by:
isNoTransaction in interface SQLConnectable

writeLob

public void writeLob(java.lang.String selectLob,
                     java.lang.Object[] params,
                     java.lang.Object body)
              throws palio.PalioException
Specified by:
writeLob in interface SQLConnectable
Throws:
palio.PalioException

writeLob

public void writeLob(java.lang.String selectLob,
                     java.lang.Object body)
              throws palio.PalioException
Specified by:
writeLob in interface SQLConnectable
Throws:
palio.PalioException

getMetaData

public final java.sql.DatabaseMetaData getMetaData()
                                            throws palio.PalioException
Specified by:
getMetaData in interface SQLConnectable
Throws:
palio.PalioException

getResultSet

public java.sql.ResultSet getResultSet()
Specified by:
getResultSet in interface SQLConnectable

getResultSetMetaData

public java.sql.ResultSetMetaData getResultSetMetaData()
Specified by:
getResultSetMetaData in interface SQLConnectable

getInfo

public java.lang.Object[] getInfo()
Overrides:
getInfo in class PooledConnector

info

public java.lang.String info()
Overrides:
info in class PooledConnector

read

public final java.util.LinkedList read(java.lang.String query)
                                throws palio.PalioException
Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

public final java.util.LinkedList read(java.lang.String query,
                                       java.lang.Object[] params)
                                throws palio.PalioException
Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

public final java.util.LinkedList read(java.lang.String query,
                                       java.lang.Object[] params,
                                       java.lang.Object[] outTypeParams)
                                throws palio.PalioException
Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

@Deprecated
public final java.util.LinkedList read(java.lang.String query,
                                                  java.lang.Long start,
                                                  java.lang.Integer count,
                                                  java.lang.String paramNameRowCount)
                                throws palio.PalioException
Deprecated. 

Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

@Deprecated
public final java.util.LinkedList read(java.lang.String query,
                                                  java.lang.Object[] params,
                                                  java.lang.Long start,
                                                  java.lang.Integer count,
                                                  java.lang.String paramNameRowCount)
                                throws palio.PalioException
Deprecated. 

Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

@Deprecated
public final java.util.LinkedList read(java.lang.String query,
                                                  java.lang.Object[] params,
                                                  java.lang.Object[] outTypeParams,
                                                  java.lang.Long start,
                                                  java.lang.Integer count,
                                                  java.lang.String paramNameRowCount)
                                throws palio.PalioException
Deprecated. 

Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

public final void read(java.lang.String rowParamName,
                       java.lang.String query,
                       palio.compiler.PalioCode code)
                throws palio.PalioException
Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

public final void read(java.lang.String rowParamName,
                       java.lang.String query,
                       java.lang.Object[] params,
                       palio.compiler.PalioCode code)
                throws palio.PalioException
Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

public final void read(java.lang.String rowParamName,
                       java.lang.String query,
                       java.lang.Object[] params,
                       java.lang.Object[] outTypeParams,
                       palio.compiler.PalioCode code)
                throws palio.PalioException
Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

@Deprecated
public final void read(java.lang.String rowParamName,
                                  java.lang.String query,
                                  java.lang.Long start,
                                  java.lang.Integer count,
                                  palio.compiler.PalioCode code)
                throws palio.PalioException
Deprecated. 

Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

@Deprecated
public final void read(java.lang.String rowParamName,
                                  java.lang.String query,
                                  java.lang.Object[] params,
                                  java.lang.Long start,
                                  java.lang.Integer count,
                                  palio.compiler.PalioCode code)
                throws palio.PalioException
Deprecated. 

Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

public final void read(java.lang.String query,
                       groovy.lang.Closure code)
                throws palio.PalioException
Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

public final void read(java.lang.String query,
                       java.lang.Object[] params,
                       groovy.lang.Closure code)
                throws palio.PalioException
Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

public final void read(java.lang.String query,
                       java.lang.Object[] params,
                       java.lang.Object[] outTypeParams,
                       groovy.lang.Closure code)
                throws palio.PalioException
Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

@Deprecated
public final void read(java.lang.String query,
                                  java.lang.Long start,
                                  java.lang.Integer count,
                                  groovy.lang.Closure code)
                throws palio.PalioException
Deprecated. 

Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

read

@Deprecated
public final void read(java.lang.String query,
                                  java.lang.Object[] params,
                                  java.lang.Long start,
                                  java.lang.Integer count,
                                  groovy.lang.Closure code)
                throws palio.PalioException
Deprecated. 

Specified by:
read in interface SQLConnectable
Throws:
palio.PalioException

readAsMaps

public final java.util.LinkedList readAsMaps(java.lang.String query)
                                      throws palio.PalioException
Specified by:
readAsMaps in interface SQLConnectable
Throws:
palio.PalioException

readAsMaps

public final java.util.LinkedList readAsMaps(java.lang.String query,
                                             java.lang.Object[] params)
                                      throws palio.PalioException
Specified by:
readAsMaps in interface SQLConnectable
Throws:
palio.PalioException

readAsMaps

public final java.util.LinkedList readAsMaps(java.lang.String query,
                                             java.lang.Object[] params,
                                             java.lang.Object[] outTypeParams)
                                      throws palio.PalioException
Specified by:
readAsMaps in interface SQLConnectable
Throws:
palio.PalioException

readAsMaps

@Deprecated
public final java.util.LinkedList readAsMaps(java.lang.String query,
                                                        java.lang.Long start,
                                                        java.lang.Integer count,
                                                        java.lang.String paramNameRowCount)
                                      throws palio.PalioException
Deprecated. 

Specified by:
readAsMaps in interface SQLConnectable
Throws:
palio.PalioException

readAsMaps

@Deprecated
public final java.util.LinkedList readAsMaps(java.lang.String query,
                                                        java.lang.Object[] params,
                                                        java.lang.Long start,
                                                        java.lang.Integer count,
                                                        java.lang.String paramNameRowCount)
                                      throws palio.PalioException
Deprecated. 

Specified by:
readAsMaps in interface SQLConnectable
Throws:
palio.PalioException

readAsMaps

public final java.util.LinkedList readAsMaps(java.lang.String query,
                                             java.lang.Object[] params,
                                             java.lang.Object[] outTypeParams,
                                             java.lang.Long start,
                                             java.lang.Integer count,
                                             java.lang.String paramNameRowCount)
                                      throws palio.PalioException
Specified by:
readAsMaps in interface SQLConnectable
Throws:
palio.PalioException

readLine

public final java.lang.Object[] readLine(java.lang.String query)
                                  throws palio.PalioException
Specified by:
readLine in interface SQLConnectable
Throws:
palio.PalioException

readLine

public final java.lang.Object[] readLine(java.lang.String query,
                                         java.lang.Object[] params)
                                  throws palio.PalioException
Specified by:
readLine in interface SQLConnectable
Throws:
palio.PalioException

readLineAsMap

public final java.util.HashMap readLineAsMap(java.lang.String query)
                                      throws palio.PalioException
Specified by:
readLineAsMap in interface SQLConnectable
Throws:
palio.PalioException

readLineAsMap

public final java.util.HashMap readLineAsMap(java.lang.String query,
                                             java.lang.Object[] params)
                                      throws palio.PalioException
Specified by:
readLineAsMap in interface SQLConnectable
Throws:
palio.PalioException