I developed an application using Jconnect 5.0 to communicate with ASA
6.0.1.1314
Everything was OK until I tried to run my DB with the runtime engine.
Here are my problems:
1) Date format is less permissive. While dbsrv6 accepts dates in the
format
'mm/dd/yyyy' , rteng6 does not.
2) Prepared statements produce an error indicating that variable @p0 is
undefined.
Is there anything a could do to solve my problem?
Thanks.
> 2) Prepared statements produce an error indicating that variable @p0 is
> undefined.
Sounds like an ASA bug. However, set the jConnect driver
property LITERAL_PARAMS=true to get around this.
>
> Is there anything a could do to solve my problem?
> Thanks.
--
===============================================================================
Lance J. Andersen Email: lan...@sybase.com
Sybase Product Support Engineering Phone:(781) 564-6336
77 South Bedford Street Fax: (781) 564-7001
Burlington, MA 01803
The Dark Knight Returns!!! Let's Go Penguins!!!
===============================================================================
> ...
> Sounds like an ASA bug. However, set the jConnect driver
> property LITERAL_PARAMS=true to get around this.
Thanks for your answer, however it did'nt work:
Before making any change my prepared statements worked OK with dbsrv6 while
rteng6 produced the following exception:
com.sybase.jdbc.SybSQLException: ASA Error -143: column '@p0' not found
at com.sybase.tds.Tds.processEed(Tds.java)
at com.sybase.tds.Tds.nextResult(Tds.java)
at com.sybase.jdbc.ResultGetter.nextResult(ResultGetter.java)
at com.sybase.jdbc.SybStatement.nextResult(SybStatement.java)
at com.sybase.jdbc.SybStatement.queryLoop(SybStatement.java)
at com.sybase.jdbc.SybStatement.executeQuery(SybStatement.java)
at com.sybase.jdbc.SybPreparedStatement.executeQuery(SybPreparedStatement.java)
Notice that I have no @p0 in my code.
Then I introduced the property as follows:
java.util.Properties props = new java.util.Properties();
props.put("user", usr);
props.put("password", pwd);
props.put("LITERAL_PARAMS", new Boolean(true));
con = DriverManager.getConnection(url,props);
With this change, i've got with both dvserv6 and rteng6 the following message:
java.sql.SQLException: JZ0SA: Prepared Statement: Input parameter not set, index:
1.
at com.sybase.jdbc.ErrorMessage.raiseError(ErrorMessage.java)
at com.sybase.tds.TdsParam.prepareForSend(TdsParam.java)
at com.sybase.jdbc.ParamManager.checkParams(ParamManager.java)
at com.sybase.tds.Tds.language(Tds.java)
at com.sybase.jdbc.SybStatement.sendQuery(SybStatement.java)
at com.sybase.jdbc.SybPreparedStatement.sendQuery(SybPreparedStatement.java)
at com.sybase.jdbc.SybStatement.executeUpdate(SybStatement.java)
at com.sybase.jdbc.SybPreparedStatement.executeUpdate(SybPreparedStatement.java)
I conclude that setting property LITERAL_PARAMS broke the prepared statement
mechanism.
Any ideas?
If this is set, you will not see @p0
--
Ascánder Suárez wrote:
> Hi,
>
> I developed an application using Jconnect 5.0 to communicate with ASA
> 6.0.1.1314
> Everything was OK until I tried to run my DB with the runtime engine.
> Here are my problems:
>
> 1) Date format is less permissive. While dbsrv6 accepts dates in the
> format
> 'mm/dd/yyyy' , rteng6 does not.
> 2) Prepared statements produce an error indicating that variable @p0 is
> undefined.
>
Lance Andersen wrote:
> should be props.put("LITERAL_PARAMS", "TRUE");
>
> If this is set, you will not see @p0
>
>
Same error. I changed the start of my program as follows:
java.util.Properties props = new java.util.Properties();
props.put("user", usr);
props.put("password", pwd);
props.put("LITERAL_PARAMS", "TRUE");
con = DriverManager.getConnection(url,props);
With both the server and the runtime engines I've got:
java.sql.SQLException: JZ0SA: Prepared Statement: Input parameter not set, index: 1.
at com.sybase.jdbc.ErrorMessage.raiseError(ErrorMessage.java)
at com.sybase.tds.TdsParam.prepareForSend(TdsParam.java)
at com.sybase.jdbc.ParamManager.checkParams(ParamManager.java)
at com.sybase.tds.Tds.language(Tds.java)
at com.sybase.jdbc.SybStatement.sendQuery(SybStatement.java)
at com.sybase.jdbc.SybPreparedStatement.sendQuery(SybPreparedStatement.java)
at com.sybase.jdbc.SybStatement.executeUpdate(SybStatement.java)
at com.sybase.jdbc.SybPreparedStatement.executeUpdate(SybPreparedStatement.java)
The text of the prepared statement is "INSERT INTO Images VALUES (?, ?)"
Other possibilities?
Your previous error was:
com.sybase.jdbc.SybSQLException: ASA Error -143: column '@p0' not found
Your current error is:
> java.sql.SQLException: JZ0SA: Prepared Statement: Input parameter not set, index: 1.
Please check your setXXX() calls.
Lance Andersen wrote:
> No,
>
> Your previous error was:
> com.sybase.jdbc.SybSQLException: ASA Error -143: column '@p0' not found
>
> Your current error is:
> > java.sql.SQLException: JZ0SA: Prepared Statement: Input parameter not set, index: 1.
>
>
Hi, Both errors were mentioned in my previous message. I'll try check the setXXX
and I'll extract a short program with my problem if it persists.
Thanks a lot.
now on to your parameter issue :-)