cancel
Showing results for 
Search instead for 
Did you mean: 

Exception: Call of execute(String) is not allowed for PreparedStatement

Former Member
0 Kudos

Hi all,

This query was run fine on SapDB 7.4 from Jave code using prepareStatement() method:

declare id11216053819634 cursor for select sc.name, measuredobjectid id from serviceconditions sc, measuredobjects mo where sc.collectionid = mo.collectionid and sc.name like 'DWindowsSLA/%,%,%,%' for reuse

declare id21216053819634 cursor for select min(sampletime), max(sampletime), name, id11216053819634.id from id11216053819634, d_slastore ss where id11216053819634.id = ss.measuredobjectid and ss.sampletime between '2008-07-14 00:00:00' and '2008-07-14 12:43:35' group by name, id11216053819634.id for reuse

select ss.status, ss.statuschange, ss.sampletime, id21216053819634.name from d_slastore ss, id21216053819634 where ss.measuredobjectid = id21216053819634.id and ss.sampletime between '2008-07-14 00:00:00' and '2008-07-14 12:43:35' and (statuschange != 0 or ss.sampletime = id21216053819634.expression1 or ss.sampletime = id21216053819634.expression2) order by name, sampletime

We recently upgrade our old SapDb to the latest MaxDB. An now this query produces the error:

com.sap.dbtech.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: Call of execute(String) is not allowed for PreparedStatement.

Does anyone know how to fix this?

Thank you very much,

Irina

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Irina,

First, welcome to SDN!

Well, PreparedStatement represents a precompiled SQL statement, so you should be using the no-arg execute() method rather than execute(String).

HTH!

\-- Vladimir

Former Member
0 Kudos

Hi Vladimir,

Thanks a lot, I already figured this out.

Irina

Answers (0)