Re: [SQL] How does postgres handle non literal string values

2002-12-04 Thread Vernon Wu
When the MVC pattern is employed and EJB is absented, the DAO pattern shall be utilized. With this system design, the DB routines are isolated from the rest of system for the purpose of "robust" as you mentioned. In the future, you only need to write another set of DAO implemention if you deci

Re: [SQL] How does postgres handle non literal string values

2002-12-04 Thread Charles H. Woloszynski
Vernon: Agreed. We use Struts (as our MVC framework), and then a data access layer (we call persistables) that uses the PreparedStatements. Our JSPs only get data to render *after* the business logic has decided that all logic has been performed successfully. The end-result is easily compartm

Re: [SQL] How does postgres handle non literal string values

2002-12-03 Thread Vernon Wu
In general, it isn't a good idea to have SQL statements in JSP files. A good practise is using Mode 2. The Struts is a popular Mode 2 framework. If your application is very small and it won't grow into a big one, you can get around using Mode 1. In the situation, the SQL tags of JSTL will be a

Re: [SQL] How does postgres handle non literal string values

2002-11-26 Thread Rob Hills
Hi, On 25 Nov 2002 at 4:57, javaholic wrote: Your problem is really a JSP one rather than a postgres problem, and probably doesn't really belong on this list. That said, I know much more java/jsp than I do postgres, so I'll try and help. > I have some jsp code that should insert a user name

Re: [SQL] How does postgres handle non literal string values

2002-11-26 Thread Charles H. Woloszynski
Actually, we use JDBC Prepared Statements for this type of work. You put a query with '?' in as placeholders and then add in the values and the library takes care of the encoding issues. This avoids the double encoding of (encode X as String, decode string and encode as SQL X on the line). T

Re: [SQL] How does postgres handle non literal string values

2002-11-26 Thread Richard Huxton
On Monday 25 Nov 2002 12:57 pm, javaholic wrote: > Hi All, > > I have some jsp code that should insert a user name and password into > a table called login. > > Instead of inserting the values given by the client, it insert the > literal string 'username' and 'password. The problem is somewhere in

Re: [SQL] How does postgres handle non literal string values

2002-11-26 Thread Henshall, Stuart - Design & Print
Title: RE: [SQL] How does postgres handle non literal string values I'm guessing it would have to be more like: <%     String insertString =     "INSERT INTO  \"login\" (\'user\', \'password\') VALUES ('

[SQL] How does postgres handle non literal string values

2002-11-26 Thread javaholic
Hi All, I have some jsp code that should insert a user name and password into a table called login. Instead of inserting the values given by the client, it insert the literal string 'username' and 'password. The problem is somewhere in the INSERT statement. Here is the code: <%@page contentType