This did not help me. The following is a query built after adding the binding variables. select ACC_NO from ACC_TABLE, where ACC_NAME = 'java.lang.String';
It tries to convert to type java.lang.String and which results in the following java.sql.SQLException exception: Failed to execute sql command - Original message: null
Where is my ACC_NAME - "user01". So actually the request should be like this, select ACC_NO from ACC_TABLE, where ACC_NAME = 'user01';
So, if my understanding is not wrong, prepareStatement.setObject (index, object) converts the data to the appropriate data type and sets it.
prepareStatement.setObject (index, object) in MySQL works fine, no problem. Only problem is using Oracle. The version of Oracle DB I'm working with
Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production PL / SQL Release 11.2.0.2.0 - Production "CORE 11.2.0.2.0 Production" TNS for 32-bit Windows: Version 11.2.0.2.0 - Production NLSRTL Version 11.2.0.2.0 - Production
source share