isSingleXXX in AbstractJdbc1Statement

From: "Chris Smith" <cdsmith(at)twu(dot)net>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: isSingleXXX in AbstractJdbc1Statement
Date: 2004-02-16 16:02:17
Message-ID: 027c01c3f4a6$40b88990$6f00000a@KYA
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

G'morning (or as appropriate for your time zone),

I'm working on refactoring some code from AbstractJdbc1Statement, and there
are comments and design all over the place indicating or assuming that the
isSingleStatement, isSingleDML, and isSingleSelect methods are terribly
expensive. As far as I can see, though, they aren't! isSingleStatement is
implicitly calculated when parsing the query, and the other two involve a
single calls to each of String.trim, String.toLowerCase, and
String.startsWith. I suppose the String.toLowerCase might be an issue for
absolutely gigantic queries, but it looks like we could deal with that by
simply doing a substring to grab the first seven letters before doing the
compare.

Anyone disagree?

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2004-02-16 16:03:46 Re: cascade delete
Previous Message Bhushan Bhangale 2004-02-16 16:02:11 Re: cascade delete