Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Performance considerations

2 posts in ,  JConnect version 3.0 JDBC Connect (product renamed to JConnect) Last posting was on 1997-10-14 06:16:23.0Z
Steve Tom Posted on 1997-10-14 01:34:09.0Z
Message-ID: <3442CC11.58F9FEAA@intouch-software.com>
Date: Mon, 13 Oct 1997 18:34:09 -0700
From: Steve Tom <sght@intouch-software.com>
X-Mailer: Mozilla 4.02 [en] (X11; I; SunOS 5.5.1 sun4m)
MIME-Version: 1.0
Subject: Performance considerations
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect,sybase.public.jconnect30
Lines: 20
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:130 sybase.public.jconnect30:1709
Article PK: 251882

I'm querying large amounts of data from the server and my applet is
taking a LONG time to come up.
In order to optimize my code I'd like to know
1. when is the data actually gets transfer from the sql server to the
applet. is it the
executeQuery? or the next() or the getString()?
2. Which one of these operations are local and which one goes to sql
server?

This is what I'm doing
1. resultset = stmt.executeQuery("select ..."); //selec t that makes
alot of hits.
2. resultset.next() // to get the next line
3. resultset.getString() //to get a specific column in the line

Thanks in advance.
-steve

--
Steve Tom
Intouch Software, Inc.
Voice: 408-278-9457; Fax: 408-975-0663
sght@intouch-software.com; http://www.intouch-software.com


David Clegg Posted on 1997-10-14 06:16:23.0Z
Message-ID: <34430E37.5C2A93DD@sybase.com>
Date: Mon, 13 Oct 1997 23:16:23 -0700
From: David Clegg <davec@sybase.com>
X-Mailer: Mozilla 3.01 (X11; I; Linux 1.2.13 i586)
MIME-Version: 1.0
To: Steve Tom <sght@intouch-software.com>
Subject: Re: Performance considerations
References: <3442CC11.58F9FEAA@intouch-software.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect,sybase.public.jconnect30
Lines: 46
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:129 sybase.public.jconnect30:1708
Article PK: 251881


Steve Tom wrote:
>
> I'm querying large amounts of data from the server and my applet is
> taking a LONG time to come up.
> In order to optimize my code I'd like to know
> 1. when is the data actually gets transfer from the sql server to the
> applet. is it the
> executeQuery? or the next() or the getString()?

executeQuery starts the operation. SQL Server will process the query
and start sending the results back to your applet. jConnect returns
control to your applet just before the first row of data comes off
the network. That first row of data is preceded by a RowFormat
token which describes how many columns were selected and something
about each column.

> 2. Which one of these operations are local and which one goes to sql
> server?
executeQuery goes to the server. Everything else is local -- just
reading data off the network and doing conversions to Java datatypes.

UNLESS you are using cursors -- if you do Statement.setCursorName()
before the executeQuery, then you will get crappy performance.


>
> This is what I'm doing
> 1. resultset = stmt.executeQuery("select ..."); //selec t that makes
> alot of hits.
> 2. resultset.next() // to get the next line
> 3. resultset.getString() //to get a specific column in the line

If you are always fetching your columns in order (from 1 -- N) and
only fetching them once per row, then you can set the REPEAT_READ
connection property to false, and get somewhat better performance.
You should also check that you do not set the LoginTimeout or
StatementTimeout to anything except 0 -- this has a performance hit
too.

dave

>
> Thanks in advance.
> -steve
>
> --
> Steve Tom
> Intouch Software, Inc.
> Voice: 408-278-9457; Fax: 408-975-0663
> sght@intouch-software.com; http://www.intouch-software.com