X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 183763A2C25 for ; Sun, 2 Jan 2005 13:00:52 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 64087-02 for ; Sun, 2 Jan 2005 13:00:43 +0000 (GMT) Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.250.190.2]) by svr1.postgresql.org (Postfix) with ESMTP id E53A33A2C0C for ; Sun, 2 Jan 2005 13:00:45 +0000 (GMT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 67FE6313D0; Sun, 2 Jan 2005 14:00:45 +0100 (MET) From: "Nico" X-Newsgroups: pgsql.interfaces.jdbc Subject: PSQLException instead of java.net.SocketException Date: Sun, 2 Jan 2005 14:00:42 +0100 Organization: Hub.Org Networking Services Lines: 42 Message-ID: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original To: pgsql-jdbc@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=3.268 tagged_above=0 required=5 tests=AWL, FORGED_YAHOO_RCVD, PRIORITY_NO_NAME X-Spam-Level: *** X-Archive-Number: 200501/1 X-Sequence-Number: 11881 Each time I initiate my servlet, I get an exception. It is thrown when I call the executeQuery method of a statement instance. He throws a PSQLException. However, when I take a look at the stack trace, it appears to be a java.net.SocketException was thrown. My best guess is the exception was catched and a PSQLException was thrown in the catch block. I already have a catch block for PSQLException which is designed to warn me for SQL syntax errors, not socket exceptions. So I want to make an additional catch block for a java.net.SocketException. However I don't know how. Can someone please help me here? Reason I want to do this: I can't solve sql syntax errors automatically, but I can solve socketexceptions automatically by just refreshing the window on the client side. However if someone can solve the cause in stead of the catching exception, that's even better. here is the exception: An I/O error has occured while flushing the output - Exception: java.net.SocketException: Socket closed here is part of the stack trace: java.net.SocketException: Socket closed at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at org.postgresql.PG_Stream.flush(PG_Stream.java:352) at org.postgresql.core.QueryExecutor.sendQuery(QueryExecutor.java:159) at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:70) at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:505) at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:320) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:48) at org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:153) at org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:141) at menus.DBMenu.getQuery(DBMenu.java:705) at menus.DBMenu.Menupage(DBMenu.java:165) at menus.DBMenuShow.doGet(DBMenuShow.java:132) Nico.