secure sql-statments

From: list(at)meinsenf(dot)at
To: pgsql-jdbc(at)postgresql(dot)org
Subject: secure sql-statments
Date: 2001-11-14 11:52:37
Message-ID: E163yar-0007L3-00@smtp.inode.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Michael Stephenson 2001-11-14 12:49:05 Re: secure sql-statments
Previous Message tony 2001-11-14 08:23:40 Re: PostgreSQL->JDBC->Tomcat->Apache resource uses