cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mick Fong <Mick.F...@kti.wa.edu.au>
Subject RE: java.sql.SQLException: Unknown Types value
Date Thu, 20 Jun 2013 01:11:33 GMT
Hi Michael,

The type is definitely a varchar in the view.

The error is when the you are setting the query object for the PreparedStatement. It appears
that the org.apache.cayenne.access.types.CharType is not being recognised as a MySQL varchar
type.

The exception is thrown from a switch on the parameter SQL type:

switch (targetSqlType) {
  .
  .
  case Types.CHAR:
  case Types.VARCHAR:
  case Types.LONGVARCHAR:
    if (parameterObj instanceof BigDecimal) {
      setString(parameterIndex,(StringUtils.fixDecimalExponent(StringUtils.consistentToString((BigDecimal)
parameterObj))));
    } else {
      setString(parameterIndex, parameterObj.toString());
    }

  break;
  .
  .
  default:
    throw SQLError.createSQLException(Messages.getString("PreparedStatement.16"), //$NON-NLS-1$
      SQLError.SQL_STATE_GENERAL_ERROR, getExceptionInterceptor());
}


The property value for the message is:
PreparedStatement.16=Unknown Types value


The error occurs just when setting the parameters because the CharType is not recognised.

thanks

mick

[Kimberley Training Institute Logo]
Toll Free: 1300 996 573 | Website: www.kti.wa.edu.au<http://www.kti.wa.edu.au>
Find us on Facebook<http://www.facebook.com/kimberleytraininginstitute>

Please consider the environment before printing this email.

Mime
View raw message