----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, April 20, 2001 2:49 AM
Subject: RE: JDBCDescriptorStore and escaping SQL
> Michael
>
> If I may offer some advice.
> The best way is to use PreparedStatement with setString and setInt, that
way
> you don't have to escape anything.
> You can even reuse the prepared statement, this will give a performance
> boost.
> Be carefull with the locking but I've read somewere that there was already
> connection lock,
> and then you don't need to worry.
>
> Some example code:
>
> PreparedStatement pstmt = con.prepareStatement("insert into property
> values(?,?,?,?,?,?,?)");
> pstmt.setString(PROPERTY_URI,uri);
> pstmt.setString(PROPERTY_NUMBER,revisionDescriptor.getRevisionNumber());
> pstmt.setString(PROPERTY_NAME,property.getName());
> pstmt.setString(PROPERTY_VALUE,property.getValue());
> pstmt.setString(PROPERTY_NAMESPACE,property.getNamespace());
> pstmt.setString(PROPERTY_TYPE,property.getType());
> pstmt.setInt(PROPERTY_PROTECTED,protectedProperty);
> pstmt.execute();
>
>
> If you're going to do special character handling maybe you could also look
> at
> characters like é Small e, acute accent ("é")
>
> I've just tied a proppatch and got the following error:
>
> 20 Apr 2001 11:36:00 - INFO - PROPPATCH (time: 31 ms) URI =
> /files/draft-fr.xml
> org.xml.sax.SAXParseException: End of entity not allowed; an end tag is
> missing.
> at com.sun.xml.parser.Parser.fatal(Parser.java:2817)
> at com.sun.xml.parser.Parser.fatal(Parser.java:2805)
> at com.sun.xml.parser.Parser.content(Parser.java:1553)
> at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
> at com.sun.xml.parser.Parser.content(Parser.java:1499)
> at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
> at com.sun.xml.parser.Parser.content(Parser.java:1499)
> at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
> at com.sun.xml.parser.Parser.content(Parser.java:1499)
> at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
> at com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
> at com.sun.xml.parser.Parser.parse(Parser.java:284)
> at
> com.sun.xml.parser.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:95)
> at
>
org.apache.slide.webdav.method.PropPatchMethod.parseRequest(PropPatchMethod.
> java:168)
The exception occurs when parsing the request.
Are you using the Slide WebDAV client ?
Remy