Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] JPQL produces SQL syntax error on Informix, but only because of PreparedStatement binding?

Hi Laird,

Does calling databasePlatform.setShouldBindLiterals(false) in a SessionCustomizer solve the issue?

-Tom

On 25/02/2013 10:42 AM, Laird Nelson wrote:
Here's what the IIUG says: http://www.iiug.org/forums/ids/index.cgi/read/29595

So the Informix guys can't understand how other databases can support parameters
in this case, if I'm reading this right.

Where/what should I override to have a chance at modifying the slots that
EclipseLink introduces here?  I need to add "::INT" to certain "?" placeholders.

Best,
Laird


On Mon, Feb 25, 2013 at 7:10 AM, Laird Nelson <ljnelson@xxxxxxxxx
<mailto:ljnelson@xxxxxxxxx>> wrote:

    On Mon, Feb 25, 2013 at 5:34 AM, Tom Ware <tom.ware@xxxxxxxxxx
    <mailto:tom.ware@xxxxxxxxxx>> wrote:

           I'm not sure what could be wrong with Informix's handling of that
        parameter binding.


    Indeed.  We've definitely narrowed it down to some fundamental flaw in
    Informix.  Specifically, it seems to be the THEN keyword's...operand, value,
    whatever.  If you change that parameter slot to a numeric literal ("THEN ?"
    to "THEN 1") then under a simple JDBC unit test everything works.
      Reintroduce that slot and it blows up.

          'some things you could experiment with to narrow it down/work around.

        - Persistence unit property: eclipselink.jdbc.bind-__parameters=false to
        turn off parameter binding
        - Persistence unit property: eclipselink.logging.__parameters=true
        combined with a logging level of FINE or better will log the parameters
        being bound so you can see if there are any issues with what is being bound
        - Query Hint: eclipselink.jdbc.bind-__parameters=false to turn off
        parameter binding on a query-by-query basis
        - DatabasePlatform.__setUsesStringBinding(boolean) set whether string
        values are bound
        - DatabasePlatform.__setShouldBindLiterals(boolean) set whether literals
        are bound


    Ah, these are good suggestions.  Thanks.  I'm also working this with the
    Informix users' group and will report back what I find there.

    Best,
    Laird

    --
    http://about.me/lairdnelson




--
http://about.me/lairdnelson


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



Back to the top