Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 77538 invoked from network); 23 Jun 2004 23:59:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 23 Jun 2004 23:59:49 -0000 Received: (qmail 57840 invoked by uid 500); 24 Jun 2004 00:00:14 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 57765 invoked by uid 500); 24 Jun 2004 00:00:12 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 65702 invoked by uid 99); 23 Jun 2004 22:55:43 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Subject: Re: java escape character save retrieve problem Reply-To: saravkrish@uky.edu From: "Saravana Krishnan Kannan" To: torque-user@db.apache.org Date: Wed, 23 Jun 2004 18:51:20 -0400 X-Mailer: NetMail ModWeb Module X-Sender: skkann2 MIME-Version: 1.0 Message-ID: <1088031080.227b64c0saravkrish@uky.edu> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mail-Router: No infection found X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Sandeep, I think this can be fix be changing the Oracle DB Adapter's code. AFAIK, = it is the Oracle DB Adapter that does the character escaping (is that the= right word??). Why don't you look into that and fix it and release it to= the community? Thats what I had to do for the BLOB and CLOB issue with O= racle. ~Sarav -----Original Message----- From: "Sandeep S. Chhikara" To: Date: Wed, 23 Jun 2004 11:59:51 -0500 Subject: java escape character save retrieve problem Hi F. FrayYes you understanding is correct. And code sample is exactly same= as you have sent. WOrking on your example, after save() method call the = database will have valueC:\dev\test\myfile.doc for column FILEPATH.Howev= er, in load() method this call List hits =3D FileObjectPeer.doSelect(crit= eria); will always return emply list since torque criteria object will generate sq= l where clause as select ......from ... where FILEPATH =3D'C:\\dev\\test\= \myfile.doc'and since database contains this value as 'C:\dev\test\myfile= .doc' nothing will be ever returned.Now if you guys are starting up on th= is project, i would suggest use"/" as path separator and everything will = be ok, since this will not need java escapecharacter.Please do reply, for= suggestion to fix the strange behaviour of torque criteria objects.thank= sSandeep Chhikara From: florianfray@compuserve.de Date: Wed, 23 Jun 2004 08:22:16 +0200 Subject: java escape character save retrieve problem Content-Type: multipart/mixed; boundary=3D"--d6f740d669e2f95" Good Morning Sandeep! Don't know if I did understand you right. You say: Saving a String with slashes works correct, but retrieving such rows doesn't work? Please send a code snippet! Would interest me since we have to do this, too! Is it something like:=20 void save() { FileObject f =3D new FileObject(); f.setPath("C:\\dev\\test\\myfile.doc"); try { f.save(); } catch (Exception e) { } } FileObject load() { Criteria criteria =3D new Criteria(); criteria.add(FileObjectPeer.PATH, "C:\\dev\\test\\myfile.doc"); try { FileObject f; List hits =3D FileObjectPeer.doSelect(criteria); if (hits.size() =3D=3D 0) { f =3D null; } else { f =3D (FileObject) hits.get(0); } return f; } catch (Exception e) { return null; } } ??? Please send your code! F. Fray ----- Originalnachricht ----- Von: "Sandeep S. Chhikara" Datum: Dienstag, 22. Juni 2004 10:53 pm Betreff: java escape character save retrieve problem > Good Afternoon Everyone,=20 >=20 > I am using torque 3.1 and experiencing a strange problem with=20 > escape character in dir path. > Environment: > jdk1.4 > torque 3.1 > MSSQlServer 2000 > OS: windows 2000 server >=20 > In database table, i have a column to store filePath. > I read a file path from file which is "SINGLE \"=20 > C:\dev\test\myfile.docand since java adds a escape"\" character so=20 > in debugging i see this path as " DOUBLE \\" C:\\dev\\test\\myfile.doc > but while saving in DB torque saves this correctly,as expected > "SINGLE \" C:\\dev\\test\\myfile.doc. > > When i try to retrieve this data using torque criteria the > filePath set as "SINGLE \" C:\dev\test\myfile.doc > and as discussed earlier java adds escape character torque > criteria has filePath value " DOUBLE \\" C:\\dev\\test\\myfile.doc. > > Now i never get the saved row back, since db value "SINGLE \" > C:\dev\test\myfile.doc will never match with > DOUBLE \\" C:\\dev\\test\\myfile.doc and hence no row is > returned back. > > The above mentioned example works fine with path as > C:/dev/test/myfile.doc ie saving and retrieval works. > > Please suggest how can i fix this problem, and make torque save > and retrieve same value. > > > thanks > Sandeep Chhikara --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org