Article View: borland.public.jbuilder.database
Article #364Re: speeding up HSQL database
From: John Moore (TeamB)
Date: Mon, 13 Nov 2006 19:26
Date: Mon, 13 Nov 2006 19:26
51 lines
2709 bytes
2709 bytes
Oliver wrote:
> Hi
>
> i have in one special project a HSQL database which in principle
> works fine, but my user complained that it gets slow once it has
> only 100 or more entries. Heres the getValueAt method which might
> have a performance problem.
Well, I guess first, what is the question..?
Second, I can not find the code you posted in the DX or dbswing source..
So.. Where did you get this code..??
John..
>
> @SuppressWarnings
> ({"ReturnOfNull", "LoopStatementThatDoesntLoop"})
> public Object getValueAt(int rowIndex, int columnIndex) {
> Statement stat = null;
> try { stat = MyDBConn.createStatement(); }
> catch (SQLException e) { return null; }
> String Order = getOrder(SetAscending);
> String sqlCmd = "SELECT * FROM Res"+Order;
> if (SetFiltered) sqlCmd = "SELECT * FROM Res WHERE "+sqlCmdFiltered+Order;
> ResultSet rs = null;
> try { rs = stat.executeQuery(sqlCmd);}
> catch (SQLException e) { return null; }
> try { while (rs.next())
> { rs.absolute(rowIndex + 1);
> if (columnIndex==0) return SpecialFormat(rs.getObject(1));
> return NumberFormat(rs.getObject(columnIndex + 1));
> }
> } catch (SQLException e) { return null; }
> return "";
> }
>
> regards
>
> Oliver
--
=============================================
TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
Post all questions and replies to this newsgroup ONLY
For papers on DataExpress, Applets, JSP, and Web Development go to:
http://www.microps.com/mps/paperFAQ.html
====================================================
Technical Details
Message-ID:
<4558c6e2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<455890fe$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1073da,70ab5adc74a60808 X-Google-Attributes: gid1073da,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Mon, 13 Nov 2006 11:26:28 -0800 From: "John Moore (TeamB)" <jbm@microps.com> User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025) MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.database Subject: Re: speeding up HSQL database References: <455890fe$1@newsgroups.borland.com> In-Reply-To: <455890fe$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 207.137.13.178 Message-ID: <4558c6e2$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1163445986 207.137.13.178 (13 Nov 2006 11:26:26 -0700) Lines: 51 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail