Package jodd.db.type

Examples of jodd.db.type.SqlType


    init();
    if (value == null) {
      setNull(index, Types.NULL);
      return;
    }
    SqlType sqlType;
    if (sqlTypeClass != null) {
      sqlType = SqlTypeManager.lookupSqlType(sqlTypeClass);
    } else {
      sqlType = SqlTypeManager.lookup(value.getClass());
    }
    try {
      if ((sqlType != null) && (dbSqlType != SqlType.DB_SQLTYPE_NOT_AVAILABLE)) {
        sqlType.storeValue(preparedStatement, index, value, dbSqlType);
      } else {
        DbUtil.setPreparedStatementObject(preparedStatement, index, value, dbSqlType);
      }
    } catch (SQLException sex) {
      throwSetParamError(index, sex);
View Full Code Here


   */
  @SuppressWarnings({"unchecked"})
  protected Object readColumnValue(int colNdx, Class destinationType, Class<? extends SqlType> sqlTypeClass, int columnDbSqlType) {
    if (colNdx != cachedColumnNdx) {
      try {
        SqlType sqlType;
        if (sqlTypeClass != null) {
          sqlType = SqlTypeManager.lookupSqlType(sqlTypeClass);
        } else {
          sqlType = SqlTypeManager.lookup(destinationType);
        }
        if (sqlType != null) {
          cachedColumnValue = sqlType.readValue(resultSet, colNdx + 1, destinationType, columnDbSqlType);
        } else {
          cachedColumnValue = resultSet.getObject(colNdx + 1);
          cachedColumnValue = TypeConverterManager.convertType(cachedColumnValue, destinationType);
        }
      } catch (SQLException sex) {
View Full Code Here

    init();
    if (value == null) {
      setNull(index, Types.NULL);
      return;
    }
    SqlType sqlType;
    if (sqlTypeClass != null) {
      sqlType = SqlTypeManager.lookupSqlType(sqlTypeClass);
    } else {
      sqlType = SqlTypeManager.lookup(value.getClass());
    }
    try {
      if ((sqlType != null) && (dbSqlType != SqlType.DB_SQLTYPE_NOT_AVAILABLE)) {
        sqlType.storeValue(preparedStatement, index, value, dbSqlType);
      } else {
        DbUtil.setPreparedStatementObject(preparedStatement, index, value, dbSqlType);
      }
    } catch (SQLException sex) {
      throwSetParamError(index, sex);
View Full Code Here

TOP

Related Classes of jodd.db.type.SqlType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.