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, I'm developing a site in which i'm continuously overwriting a file with more contents. But the page when refreshed doesn't reflect the changes. However if i download the page using ftp, the page actually contains more data. What could be the problem. Please help. Also in a user input form, if the user enters a text containing quotes, then the sql query reports an error. Is there any possible solution. Thanx in advance Gaurav
What do you mean by "if I download the page using FTP, the page actually contains more data". What is being updated, the JSP page or the file? It's hard to figure out what you're doing wrong if we can't see your code. The SQL error is caused by your building a query string dynamically from whatever the user enters:
You can see that if userInput contains "O'Brian", you'll get garbled SQL. A better approach is to use a prepared statement:
Note that you don't need quotes around the "?", whether the value is numeric or string. ------------------ Phil Hanna Author of : JSP: The Complete Reference Instant JavaServlets [This message has been edited by Phil Hanna (edited April 15, 2001).]
Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127686/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072124253/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">Instant Java Servlets</A>