Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 73E879FB5CA for ; Tue, 26 Jun 2007 22:20:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 64768-06 for ; Tue, 26 Jun 2007 22:20:13 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from bay0-omc2-s34.bay0.hotmail.com (bay0-omc2-s34.bay0.hotmail.com [65.54.246.170]) by postgresql.org (Postfix) with ESMTP id 01E7E9FB58F for ; Tue, 26 Jun 2007 22:20:12 -0300 (ADT) Received: from hotmail.com ([65.55.132.110]) by bay0-omc2-s34.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Tue, 26 Jun 2007 18:20:11 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 26 Jun 2007 18:20:11 -0700 Message-ID: Received: from 65.55.132.123 by by127fd.bay127.hotmail.msn.com with HTTP; Wed, 27 Jun 2007 01:20:09 GMT X-Originating-IP: [82.46.137.185] X-Originating-Email: [mutuah@hotmail.co.uk] X-Sender: mutuah@hotmail.co.uk In-Reply-To: <20070627005819.0D8FE8B2A1F@mx2.hub.org> From: "Mutua K" To: pgsql-admin@postgresql.org Subject: Re: An I/O error occured while sending to the backend Date: Wed, 27 Jun 2007 02:20:09 +0100 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 27 Jun 2007 01:20:11.0285 (UTC) FILETIME=[4E8D9450:01C7B859] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.238 tagged_above=0 required=5 tests=AWL=-0.929, BAYES_20=-0.74, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, MSGID_FROM_MTA_HEADER=0 X-Spam-Level: X-Archive-Number: 200706/276 X-Sequence-Number: 25944 Any help? Am reading a couple of values from a txt file and store them in a table. The first line of the txt file is read well and saved. When the program reads the second line, it displays the errors listed down. Here is a method am using: public boolean addUser( String ID, String Password, String lastName, String firstName) throws SQLException, ClassNotFoundException, IOException { conn = Connect.getConnection(); while (in.ready()) { String line = in.readLine(); st = new StringTokenizer(line); while (st.hasMoreTokens()){ myID = st.nextToken(); myPassword = st.nextToken(); mylastName = st.nextToken(); myfirstName = st.nextToken(); ID = myID; Password = myPassword; lastName = mylastName; firstName = myfirstName; String sql = "INSERT INTO supervisor " + "(superv_id, superv_pass, superv_lastname, superv_firstname)" + "VALUES (?,?,?,?)"; prep = conn.prepareStatement(sql); prep.setString(1, ID); prep.setString(2, Password); prep.setString(3, lastName); prep.setString(4, firstName); prep.executeUpdate(); conn.close(); } } return true; } Error: Exception in thread "main" org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Exception: java.io.IOException: Stream closed Stack Trace: java.io.IOException: Stream closed at sun.nio.cs.StreamEncoder.ensureOpen(StreamEncoder.java:38) at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:151) at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213) at org.postgresql.core.PGStream.flush(PGStream.java:507) at org.postgresql.core.v3.QueryExecutorImpl.sendSync(QueryExecutorImpl.java:675) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:190) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:351) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:305) at prototype.PopulatingDB.addUser(PopulatingDB.java:68) at prototype.PopulatingDB.(PopulatingDB.java:29) at prototype.PopulatingDB.main(PopulatingDB.java:77) End of Stack Trace at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:217) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:351) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:305) at prototype.PopulatingDB.addUser(PopulatingDB.java:68) at prototype.PopulatingDB.(PopulatingDB.java:29) at prototype.PopulatingDB.main(PopulatingDB.java:77) Java Result: 1 _________________________________________________________________ Tell MSN about your most memorable emails! http://www.emailbritain.co.uk/