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 D5E183A4C61 for ; Fri, 21 Jan 2005 23:12:43 +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 22388-01 for ; Fri, 21 Jan 2005 23:12:32 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 1B6323A4E78 for ; Fri, 21 Jan 2005 21:32:34 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.13.1/8.13.1) with ESMTP id j0LLWUTr063649 for ; Fri, 21 Jan 2005 21:32:30 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.13.1/8.13.1/Submit) id j0LL6oH3059551 for pgsql-jdbc@postgresql.org; Fri, 21 Jan 2005 21:06:50 GMT (envelope-from news) From: "Nico" X-Newsgroups: pgsql.interfaces.jdbc Subject: sql action command doesn't work Date: Fri, 21 Jan 2005 22:06:36 +0100 Organization: Hub.Org Networking Services Lines: 57 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=0.539 tagged_above=0 required=5 tests=ALL_TRUSTED, FORGED_YAHOO_RCVD, PRIORITY_NO_NAME X-Spam-Level: X-Archive-Number: 200501/213 X-Sequence-Number: 12093 Hello, I have a servlet that generates a menu from a database. Now I am developping one that can change the data in that database via a web interface. However, when I do a executeUpdate it doesn't work. It doesn't give an error, it does just nothing. That's what's so strange. Anybody any suggestions? Nico. Here is the method that handles it: protected static ResultSet getQuery(String strstatement, Statement statement) throws SQLException, DriverNotFoundException, ConnectionException { if(strstatement==null) throw new SQLException("strstatement is null."); if(connection==null) { connect(strDbdriver, "getQuery"); if(connection==null) throw new menus.ConnectionException(strDbdriver, "getQuery","connection is null."); if(statement==null) statement=connection.createStatement(); } if(statement==null) { throw new SQLException("statement is null."); } ResultSet resultset; if(strstatement.startsWith("SELECT")) { resultset=statement.executeQuery(strstatement); if(resultset==null) throw new SQLException("Resultset is null at getQuery()."); if(resultset.getWarnings()==null) return resultset; else { String errmessage=""; while(resultset.getWarnings().getErrorCode()!=0) { errmessage+=resultset.getWarnings().getMessage()+"\n"; resultset.getWarnings().getNextException(); } throw new SQLException("SQL Error getQuery(): "+errmessage); } } else { statement.executeUpdate(strstatement); return null; } }