org.mule.module.db.internal.domain.type
Class DynamicDbType

java.lang.Object
  extended by org.mule.module.db.internal.domain.type.DynamicDbType
All Implemented Interfaces:
DbType

public class DynamicDbType
extends Object
implements DbType

Defines a type that is dynamically resolved


Constructor Summary
DynamicDbType(String name)
           
 
Method Summary
 int getId()
           
 String getName()
           
 Object getParameterValue(CallableStatement statement, int index)
          Gets the value of an output parameter
 void registerOutParameter(CallableStatement statement, int index)
          Registers an output parameter
 void setParameterValue(PreparedStatement statement, int index, Object value)
          Sets the value of an input parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicDbType

public DynamicDbType(String name)
Method Detail

getId

public int getId()
Specified by:
getId in interface DbType
Returns:
data type ID

getName

public String getName()
Specified by:
getName in interface DbType
Returns:
data type name

getParameterValue

public Object getParameterValue(CallableStatement statement,
                                int index)
                         throws SQLException
Description copied from interface: DbType
Gets the value of an output parameter

Specified by:
getParameterValue in interface DbType
Parameters:
statement - statement that contains the parameter
index - index of the parameter in the statement (first parameter is 1, the second is 2, etc)
Throws:
SQLException - if parameterIndex does not correspond to a parameter marker in the SQL statement; if a database access error occurs; this method is called on a closed statement

setParameterValue

public void setParameterValue(PreparedStatement statement,
                              int index,
                              Object value)
                       throws SQLException
Description copied from interface: DbType
Sets the value of an input parameter

Specified by:
setParameterValue in interface DbType
Parameters:
statement - statement that contains the parameter
index - index of the parameter in the statement (first parameter is 1, the second is 2, etc)
value - value to assign
Throws:
SQLException - if parameterIndex does not correspond to a parameter marker in the SQL statement; if a database access error occurs; this method is called on a closed PreparedStatement or the type of the given object is ambiguous

registerOutParameter

public void registerOutParameter(CallableStatement statement,
                                 int index)
                          throws SQLException
Description copied from interface: DbType
Registers an output parameter

Specified by:
registerOutParameter in interface DbType
Parameters:
statement - statement that contains the parameter
index - index of the parameter in the statement (first parameter is 1, the second is 2, etc)
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closed CallableStatement


Copyright © 2003–2014 MuleSoft, Inc.. All rights reserved.