org.sqlproc.engine.jdbc.type
Class JdbcTextType

java.lang.Object
  extended by org.sqlproc.engine.type.SqlMetaType
      extended by org.sqlproc.engine.type.SqlInternalType
          extended by org.sqlproc.engine.type.SqlProviderType
              extended by org.sqlproc.engine.type.SqlTextType
                  extended by org.sqlproc.engine.jdbc.type.JdbcTextType
All Implemented Interfaces:
JdbcSqlType

public class JdbcTextType
extends SqlTextType
implements JdbcSqlType

The JDBC META type TEXT.

Author:
Vladimir Hudec

Field Summary
 
Fields inherited from class org.sqlproc.engine.type.SqlMetaType
logger
 
Constructor Summary
JdbcTextType()
           
 
Method Summary
 Object get(CallableStatement cs, int index)
          Retrieves the value of the designated parameter from CallableStatement object as a Java type value.
 Object get(ResultSet rs, String columnLabel)
          Retrieves the value of the designated column in the current row of this ResultSet object as a Java type value.
 Object getProviderSqlNullType()
          Returns the type provided by the stack on top of which the SQL Processor works.
 Object getProviderSqlType()
          Returns the type provided by the stack on top of which the SQL Processor works.
 void set(PreparedStatement st, int index, Object value)
          Sets the designated parameter to the given Java value.
 
Methods inherited from class org.sqlproc.engine.type.SqlTextType
addScalar, getClassTypes, getMetaTypes, setParameter, setResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcTextType

public JdbcTextType()
Method Detail

getProviderSqlType

public Object getProviderSqlType()
Returns the type provided by the stack on top of which the SQL Processor works.

Specified by:
getProviderSqlType in class SqlProviderType
Returns:
the provided type

getProviderSqlNullType

public Object getProviderSqlNullType()
Returns the type provided by the stack on top of which the SQL Processor works. It has to support null input/output values.

Specified by:
getProviderSqlNullType in class SqlProviderType
Returns:
the provided type

get

public Object get(ResultSet rs,
                  String columnLabel)
           throws SQLException
Retrieves the value of the designated column in the current row of this ResultSet object as a Java type value.

Specified by:
get in interface JdbcSqlType
Parameters:
rs - a ResultSet instance
columnLabel - the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns:
the column value; if the value is SQL NULL, the value returned is null
Throws:
SQLException - if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

set

public void set(PreparedStatement st,
                int index,
                Object value)
         throws SQLException
Sets the designated parameter to the given Java value. The JDBC driver converts this to the appropriate SQL type value.

Specified by:
set in interface JdbcSqlType
Parameters:
st - a PreparedStatement instance
index - the first parameter is 1, the second is 2, ...
value - the parameter value
Throws:
SQLException - if parameterIndex does not correspond to a parameter marker in the SQL statement; if a database access error occurs or this method is called on a closed PreparedStatement

get

public Object get(CallableStatement cs,
                  int index)
           throws SQLException
Retrieves the value of the designated parameter from CallableStatement object as a Java type value.

Specified by:
get in interface JdbcSqlType
Parameters:
cs - a CallableStatement instance
index - the first parameter is 1, the second is 2, ...
Returns:
the parameter value; if the value is SQL NULL, the value depends on the Java type
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closed CallableStatement


Copyright © 2015. All rights reserved.