secure sql-statments - Mailing list pgsql-jdbc

From list@meinsenf.at
Subject secure sql-statments
Date
Msg-id E163yar-0007L3-00@smtp.inode.at
Whole thread Raw
Responses Re: secure sql-statments  (Michael Stephenson <mstephenson@tirin.openworld.co.uk>)
List pgsql-jdbc

hi,
I want to make my web-app secure against evil sql-statments!

my sql-strings look like:

updateString = "update table_1 set col_1 = '" + postParam_1 + "'";
selectString = "select col_1 from table_1 where col_1 like '" + postParam + "'";
generalSelectString = postParam;

what characters do I have to quote, so that the client can't submit evil sql-statments?

ok: 2 characters i must quote: "'" -> "\'" and "\" -> "\\"
what characters do I need to quote else???
perhaps ";" -> "\;"

thanks
michi

pgsql-jdbc by date:

Previous
From: Nikk Anderson
Date:
Subject: Re: PostgreSQL->JDBC->Tomcat->Apache resource uses
Next
From: Michael Stephenson
Date:
Subject: Re: secure sql-statments