OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: Passing parameters from java

From: Fabio Pinotti (fabio.pinottiicteam.it)
Date: Thu Jun 10 2004 - 05:14:57 CDT


Hi massimo,
    I dont' understand your answer. Where do you see field name?

Thanks
Fabio

----- Original Message -----
From: "Massimo Renzi (MaticaSrl)" <m.renzimaticasrl.it>
To: "Fabio Pinotti" <fabio.pinottiicteam.it>; <maxdblists.mysql.com>
Sent: Thursday, June 10, 2004 11:41 AM
Subject: R: Passing parameters from java

> Ciao Fabio,
> i parametri non puoi passare il nome di un campo come parametro.
>
> ciao
>
> Hi Fabio,
> I think that you cannot pass a field name as a parameter.
>
> bye
>
> maxsoft
>
> -----Messaggio originale-----
> Da: Fabio Pinotti [mailto:fabio.pinottiicteam.it]
> Inviato: giovedì 10 giugno 2004 11.19
> A: maxdblists.mysql.com
> Oggetto: Passing parameters from java
>
>
> Hi,
> I have this simple piece of java code that gives me an error (it is
just
> a dummy slq expresson that include the error I get on a more complex
> query...):
>
> String sqlString="Select 1 FROM DUAL WHERE
> " DECODE(?,'1','ONE','NOT_ONE')='ONE'" +
> " AND ?='guest'";
>
> PreparedStatement st= cn.prepareStatement(sqlString);
> st.setObject(1,"0");
> st.setObject(2,"guest");
> ResultSet rs=st.executeQuery();
>
> The error is
>
> javax.servlet.ServletException: SAP DBTech JDBC: Parameter 1: value too
> large.
>
> The connection seems to be valid, because I succesfully execute other sql
> commands.
> The strange thing is that the following statement, executed with the same
> code above, runs succesfully
>
> String sqlString="Select 1 FROM DUAL WHERE " +
> " ?='1'" +
> " AND ?='guest'";
>
> so it seems that the problem is raised by "decode"....
> I tried to specify parameter types, or to use setString instead of
> setObject, but nothing changes.
>
>
> Thanks
>
> Fabio
>
>
> --
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe:
http://lists.mysql.com/maxdb?unsub=matt.woodsadsdish.com
>
>

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb