Monday, July 21, 2008

Re: [JDBC] issue with select IN (?) query

Hello Arun,

Arun ViswanathanChandrika schrieb:



        pm = con.prepareStatement("SELECT EMP_NAME FROM EMP where EMP_ID IN (?) ");
        pm.setString(1, "2,5,7");        //created many employees and id with 2, 5 and 7

Resolves to: SELECT EMP_NAME FROM EMP where EMP_ID IN ('2,5,7');

Watch the "'"'s :)

With best regards,
Daniel Migowski

No comments: