This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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 Java Servlets [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>