Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: error in jdbc OracleConnection

Re: error in jdbc OracleConnection

From: Avi Abrami <aabrami_at_intersystemsww.com>
Date: Sun, 24 Feb 2002 11:09:05 +0200
Message-ID: <3C78ADB1.3CDE367C@intersystemsww.com>


perseus wrote:

> hi all, I am right now using oracle to write jsp /servlet with tomcat 4.0.2
> . But I always get the following error:
>
> java.io.WriteAbortedException: Writing aborted by exception;
> java.io.NotSerializableException: oracle.jdbc.driver.OracleConnection
>
> I have class called
>
> public OraConnBean implements Serializable {
> String URL, username, passwd, driver;
> public void connect( ) { ... }
> }
>
> public class ReportBean implements Serializable {
> ....
> public void SaveReport( ) {
> Connection _conn = (Connection) beans.instantiate (.... ,
> OraConnBeanPath );
> // do the rest of sql;
> }
> }
>
> I serialize the OraConn to a bean and then the SaveReport action will
> instantiate it. So why I get the above error ? And can I put the OraConn
> bean in the session such that I can connect using the instantiated bean next
> time to prevent connecting again ?
> thanks .
>
> perseus

Hi perseus,
Like the error message says, a Connection is not serializable (and you can't make it serializable either). You need to figure out a different way to solve your problem (I don't have any ideas, I'm afraid).

Good Luck,
Avi. Received on Sun Feb 24 2002 - 03:09:05 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US