cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ron Chan" <rcli...@i-tao.com>
Subject Re: Help in java
Date Wed, 16 Aug 2000 06:55:43 GMT
Hi 

here are the errors I found...

<!CDATA[  should be  <![CDATA[

<page title="Password"> should come after <xsp:structure> ....</xsp:structure>

String url = jdbc:postgresql.Driver; should be String url = "jdbc:postgresql.Driver";

same for String usr

there was an extra ">" after  java.text.*
 
hope this helps 
  

Ron Chan
mailto:rchan@i-tao.com
www.i-tao.com
i-tao ltd
4 Skyline Village
Limeharbour
London E14 9TS
UK
44 (0)20 7537 2233 office
44 (0)79 6807 2040 mobile

  ----- Original Message ----- 
  From: Wong Shin Neng 
  To: cocoon-users@xml.apache.org 
  Sent: Wednesday, August 16, 2000 6:04 AM
  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