aspose file tools*
The moose likes JDBC and the fly likes OK here's a daft SQL problem for you... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "OK here Watch "OK here New topic
Author

OK here's a daft SQL problem for you...

Bob Backlund
Ranch Hand

Joined: Jun 05, 2003
Posts: 51
OK second post of the day. Got my DB working and got my JSPs displaying and removing and inserting data, etc... But!

Noticed a problem in the code. If in and of the text firlds I put a ' or " symbol, it kills the SQL. I know this is because the query string is just that, a string (in Java/JSP); and the quote is obviously cutting off the end of the string. But does anyone know away round this? Aparft from the obvious, don't have ' or " in the string! :-)


Cheers!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60063
    
  65

Are you using parameterized PreparedStatements? If not, you should. It will handle all the delimiter nonsense for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OK here's a daft SQL problem for you...
 
Similar Threads
double Type of Value in JTable
String to byte? and string to byte[]?
MS Access getting on my nerves
Head Frist --can not run the v2 beerselection app
ORA-01009-missing mandatory parameter