Hi James,
Thanks a lot for reply. I apologize that I did not post the table structure but yes you are right..the fields that I am querying on are CHAR(100).
Unfortunately, I wont be able to change DB table structure now(as I will have to change code too)..probably its bad on our side to design it that way.
However,I would like to try the options that you have mentioned
1. You can disable binding in TopLink through the persistence.xml property, "eclipselink.jdbc.bind-parameters"="false".
I am posting my persistence.xml here..As its Netbeans oriented..I could not find the parameter that you have mentioned.
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="OracleAndMySQL-ejbPU2" transaction-type="JTA">
<jta-data-source>OracleDS</jta-data-source>
<properties/>
</persistence-unit>
<persistence-unit name="OracleAndMySQL-ejbPU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>Synchronization</jta-data-source>
<properties/>
</persistence-unit>
</persistence>
2. You could also disable binding for just the query.
-->How can I do this?
3. If you space padded the string to the size of the CHAR column it would also work with binding on.
-->I will try this..but this basically means, I have to get string length and set it to 100 dynamically(if not).
Here is the table structure and I am querying on state, firstname, lastname, city, country and zipcode.
SQL> desc f_profile;
Name Null? Type
----------------------------------------- -------- ----------------
USER_ID NOT NULL NUMBER
FIRST_NAME NOT NULL CHAR(100)
LAST_NAME NOT NULL CHAR(100)
EMAIL NOT NULL VARCHAR2(4000)
ADDRESS NOT NULL VARCHAR2(4000)
CITY NOT NULL CHAR(100)
STATE NOT NULL CHAR(100)
ZIPCODE NOT NULL NUMBER
COUNTRY NOT NULL CHAR(100)
PASSWORD NOT NULL VARCHAR2(20)
Thanks a lot for your response. Not sure why DB person kept it CHAR instead of VARCHAR2.
Regards,
Chintan.