cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Re: java.sql.SQLException: Unknown Types value
Date Wed, 19 Jun 2013 13:28:06 GMT
Hi Mick,

Since this exception is occurring in the JDBC driver and not Cayenne, you
may want to double-check the types for your view.

mrg


On Wed, Jun 19, 2013 at 3:20 AM, Mick Fong <Mick.Fong@kti.wa.edu.au> wrote:

> When trying to do a search on a view I get the following error
>
> java.sql.SQLException: Unknown Types value
>         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
>         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
>         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
>         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
>         at
> com.mysql.jdbc.PreparedStatement.setObject(PreparedStatement.java:4314)
>         at
> com.mysql.jdbc.PreparedStatement.setObject(PreparedStatement.java:4106)
>         at
> org.apache.cayenne.access.types.CharType.setJdbcObject(CharType.java:169)
>         at
> org.apache.cayenne.dba.JdbcAdapter.bindParameter(JdbcAdapter.java:542)
> .
> .
> .
>
> The PreparedStatement looks ok:
>
> INFO: SELECT t0.id, t0.bookname, t0.count, t0.location_id, t0.book_id,
> t0.locationname FROM locationbook t0 WHERE UPPER(t0.bookname) LIKE UPPER(?)
> [bind: 1->bookname:'%naut%']
>
> The bookname field is a varchar(100)
>
> It works fine when I run a direct SQL statement on the db as:
>
> SELECT t0.id, t0.bookname, t0.count, t0.location_id, t0.book_id,
> t0.locationname FROM locationbook t0 WHERE UPPER(t0.bookname) LIKE
> UPPER('%naut%')
>
> I am using MySQL 5.5.22 and tried both mysql-connector-java-5.1.19 and
> mysql-connector-java-5.1.25 with the same result.
>
>
> thanks in advance
>
> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message