isSingleXXX in AbstractJdbc1Statement - Mailing list pgsql-jdbc

From Chris Smith
Subject isSingleXXX in AbstractJdbc1Statement
Date
Msg-id 027c01c3f4a6$40b88990$6f00000a@KYA
Whole thread Raw
Responses Re: isSingleXXX in AbstractJdbc1Statement  (Oliver Jowett <oliver@opencloud.com>)
List 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


pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: cascade delete
Next
From: Andrew Rawnsley
Date:
Subject: Re: cascade delete