--------------------------------------------------------------------------------

Hey all,

Does anyone know - or have any ideas why the following error occurs?

'An I/O error occured while sending to the backend'

All works well, and no errors are encountered until I cast the resultsetmetadata to PGResultSetMetaData and then try to retrieve the basetable name...complete error message is at bottom of this post.

For eg,
pgrsmd =(PGResultSetMetaData)rs.getMetaData();
String colName=getColAlias(rsmd.getColumnName(i),pgrsmd.getBaseTableName(i));

error occurs here due to the pgrsmd.getBaseTableName(i)....

The error is caused by java.io.IOException: Stream closed...but note i have not closed the connection to the database (if i omit the above line and work with just rs works fine no errors or other problems)...

Any suggestions, advice to resolve this problem will be v much appreciated!

Thanks in advance

sub.

error recieved when run:

org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
at org.postgresql.core.v3.QueryExecutorImpl.execute(Q ueryExecutorImpl.java:214)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execut e(AbstractJdbc2Statement.java:437)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execut eWithFlags(AbstractJdbc2Statement.java:353)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execut eQuery(AbstractJdbc2Statement.java:257)
at org.postgresql.jdbc2.AbstractJdbc2ResultSetMetaDat a.getBaseTableName(AbstractJdbc2ResultSetMetaData. java:519)
at UserInterfaces.DynamicTable.setUpJTable(DynamicTab le.java:79)
at UserInterfaces.MainInterface.selectRiskReview(Main Interface.java:2804)
at UserInterfaces.MainInterface.jComboOkActionPerform ed(MainInterface.java:2267)
at UserInterfaces.MainInterface.access$2500(MainInter face.java:33)
at UserInterfaces.MainInterface$26.actionPerformed(Ma inInterface.java:1544)
at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:234)
at java.awt.Component.processMouseEvent(Component.jav a:5488)
at javax.swing.JComponent.processMouseEvent(JComponen t.java:3126)
at java.awt.Component.processEvent(Component.java:525 3)
at java.awt.Container.processEvent(Container.java:196 6)
at java.awt.Component.dispatchEventImpl(Component.jav a:3955)
at java.awt.Container.dispatchEventImpl(Container.jav a:2024)
at java.awt.Component.dispatchEvent(Component.java:38 03)
at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:3822)
at java.awt.Container.dispatchEventImpl(Container.jav a:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774 )
at java.awt.Component.dispatchEvent(Component.java:38 03)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 463)
at java.awt.EventDispatchThread.pumpOneEventForHierar chy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:110)
Caused by: 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(OutputStreamWrite r.java:213)
at org.postgresql.core.PGStream.flush(PGStream.java:5 01)
at org.postgresql.core.v3.QueryExecutorImpl.sendSync( QueryExecutorImpl.java:672)
at org.postgresql.core.v3.QueryExecutorImpl.execute(Q ueryExecutorImpl.java:187)
... 33 more