im working oracle database 11g release 2, , im using apache commons dbutils v1.6, jdk 8 , tomcat 8.0.30. im using queryrunner , method , works fine if concat variables in text
query.query ("select * table field = '"+value+"'", rsh);
lately have been trying query proper way using prepared statements no avail, every time bind parameters using query method
query.query ("select estrec,lote,fecrec prueba.recaudo_enc nitrec = ? , estrec = ? order fecrec desc", rsh, new object[]{"1234","pg"});
i error no aparent reason
java.sql.sqlexception: ora-00942: table or view not exist query: select estrec,lote,fecrec prueba.recaudo_enc nitrec = ? , estrec = ? order fecrec desc; parameters: [1234, pg]
im 100% sure table exists, , user has permissions table , if same query concatenating params in query runs fine, im looking reasons behind behaviour, there wrong in usage of method?. have read somewhere there problem blob binding using dbutils oracle, related in someway?
correct query syntax oracle is:
query.query ("select estrec,lote,fecrec prueba.recaudo_enc nitrec = :p1 , estrec = :p2 order fecrec desc", rsh, new object[]{"1234","pg"});
Comments
Post a Comment