This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi all, My issue is that I want to skip the updation of one parameter, without getting an exception. I am not setting the first parameter.Here is the code snippet. Can anyone please help ? con=ConnectionManager.getConnection(); PreparedStatement ps = con.prepareStatement("UPDATE GIFI SET DESCRIPTION=?,TYPE=? WHERE ACCNO=?"); ps.setString(2, "CHEQUE"); ps.setString(3, "1000"); System.out.println(ps.execute()); Thanks Manu
It doesn't make sense to skip a parameter, as the resulting SQL would look something like this: UPDATE GIFI SET DESCRIPTION=?,TYPE='CHEQUE' WHERE ACCNO='1000' Don't you see the problem with the bad resulting SQL?