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.

executeQuery() hangs...

2 posts in JDBC Connect (product renamed to JConnect) Last posting was on 1997-07-08 00:42:05.0Z
David F. Ottow Posted on 1997-07-03 17:06:36.0Z
Message-ID: <33BBDC1C.524B@trema.com>
Date: Thu, 03 Jul 1997 19:06:36 +0200
From: "David F. Ottow" <dottow@trema.com>
Organization: Trema Laboratories SARL
X-Mailer: Mozilla 3.01 (X11; I; SunOS 5.6 sun4u)
MIME-Version: 1.0
Subject: executeQuery() hangs...
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Newsgroups: sybase.public.jdbcconnect
Lines: 59
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:588
Article PK: 252341

Hello,

I have a problem that I can't for the life of me resolve!

I have a program that makes connection to a remote database (duh).
It works fine, no bugs, clean, everything is fine...

If I launch my application and let it sit for ...oh 5 minutes or so...
and then I click on a button (i.e., launch a new query) it just hangs...
no exceptions, no errors... it just *hangs*.

Here is how I go about making my call...

public class exampleCode
{
Connection _held_connection;

...

public class doSomething(String cool_data)
{
if (_held_connection == null || _held_connection.isClosed())
{
_held_connection = myGetConnection();
}
CallableStatement proc;
proc = conn.prepareCall("{?=call coolProc(?)}");
proc.registerOutputParameter(1, Types.INTEGER);
proc.setString(2, cool_data)
// IT HANGS RIGHT AFTER I CALL THE NEXT LINE
ResultSet result = proc.executeQuery();
System.out.println("You'll never see me!! :( ");
...
}


public Connection myGetConnection()
{
Connection conn = null;
Properties info = new Properties();
info.put( "user", "guest");
info.put( "password", "duh");
while ( conn == null )
{
try
{
conn = DriverManager.getConnection( _url, info );
}
catch (SQLException e)
{
System.out.println("DOH!");
}
if (conn == null)
{
System.out.println("DUH... try again!");
}
}
return conn;
}


Now I want to make clear that this code works *perfectly* if I'm
interacting a lot with the database... even if I use it for an hour or
more!!! If I just let it sit there for a few minutes (no, not the
computer, but the app.) then it hangs...

Help!!!!!! Please!!!!

Thanks

David Ottow

~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~
Trema Laboratories SARL | David F. Ottow
http://www.trema.com | Phone: +33-4-92-38-81-06
1300, Route des Crêtes | Fax: +33-4-92-38-81-99
06560 Valbonne | Cell: +33-6-80-42-12-40
FRANCE | Email: dottow@trema.com


Mary Peek Posted on 1997-07-08 00:42:05.0Z
Message-ID: <33C18CDD.11A0@sybase.com>
Date: Mon, 07 Jul 1997 17:42:05 -0700
From: Mary Peek <maryp@sybase.com>
Reply-To: maryp@sybase.com
Organization: Sybase
X-Mailer: Mozilla 3.01Gold (Win95; I)
MIME-Version: 1.0
Subject: Re: executeQuery() hangs...
References: <33BBDC1C.524B@trema.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 17
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:585
Article PK: 252337

You might want to turn on debugging to get more information about what
is going on. Do this by adding:
import jdbc.sybase.utils.Debug
...
try
{
Debug.debug(true, "ALL");
}
catch (IOException ioe)
{
System.out.println("Error turning on debugging " + ioe);
}

Regards,
Mary Peek

David F. Ottow wrote:

> I have a program that makes connection to a remote database (duh).
> It works fine, no bugs, clean, everything is fine...
>
> If I launch my application and let it sit for ...oh 5 minutes or so...
> and then I click on a button (i.e., launch a new query) it just hangs...
> no exceptions, no errors... it just *hangs*.