cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Dupuy <ddu...@baan.com>
Subject RE: Help in java
Date Wed, 16 Aug 2000 07:38:51 GMT
well..firstly of all it's <![CDATA[ instead of <!CDATA[ and moreover i don't
think you need that in your sample code. Secondly, be carreful with  your
select query. It must be String id="'12345'"; instead of String id="12345";
Tell me if it works or give me the exact error message.
 
David


-----Original Message-----
From: Wong Shin Neng [mailto:wsn@sebasasia.com]
Sent: 16. august 2000 07:05
To: cocoon-users@xml.apache.org
Subject: Help in java


Hello people out there,
 
Can someone help me out there?  I'm new in this cocoon stuff but I'm trying
to get a wholesale ordering system up as soon as possible.  I'm no good in
java so lots of help is appreciated.
 
I've written the code below to try some testing to match a user's submitted
password and verify it with a database and return results like OK and NOT OK
 
Here's the code:
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
 

<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
 
<page title="Password">
 
<xsp:structure>
<xsp:include>java.sql.*</xsp:include>
<xsp:include> java.text.*></xsp:include>
</xsp:structure>
 
<xsp:logic><!CDATA[
  String url = jdbc:postgresql.Driver;
  String usr = postgres;
  String id="12345";
  Class.forName("org.postgresql.Driver");
    
  Connection db = DriverManager.getConnection(url, usr, pwd);
    
  Statement  st = db.createStatement();
    
  ResultSet rs = st.executeQuery("select password from customer where
personal_id="+id);
    if(rs!=null) {
      String password = rs.getString("password");
      }
  rs.close();         
  st.close();
  db.close();
]]>    
</xsp:logic>
 
 <pass>
 <xsp:expr>password</xsp:expr>
 </pass>
</page>
</xsp:page>
 
 
I get some error code of the code not well-formed.  What's wrong?  
 
Thanks in advance


Mime
View raw message