Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: error in jdbc OracleConnection
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
![]() |
![]() |