Srinivas,

>From the error, it sounds like you're not doing the OutputStream write
in the context of an open database connection.  You don't show enough
code to know, however.

You might find http://idiacomputing.com/moin/OracleLobs of interest.

 - George Dinwiddie

> -----Original Message-----
> From: Srinivas Vakkalanka [mailto:[EMAIL PROTECTED] 
> Sent: Friday, May 12, 2006 8:49 AM
> To: 'Struts Users Mailing List'
> Subject: Problem in saving file content in DB using BLOB
> 
> 
> Hi,
> 
> I am using BLOB object through LOB package to save file 
> content in oracle 9.2.0.1 I have created the blob object. But 
> when I am writing data in to the blob it is giving the 
> following error. Kindly help in this regard 
> 
>  
> 
> It gives the following Error:
> 
>  
> 
> java.sql.SQLException: Must be logged on to server         
> 
> at 
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:13
> 4)       
> 
> at 
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:17
> 9)       
> 
> at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)   
> 
> at 
> oracle.jdbc.ttc7.TTC7Protocol.assertLoggedIn(TTC7Protocol.java
> :2196)   
> 
> at 
> oracle.jdbc.ttc7.TTC7Protocol.getLobChunkSize(TTC7Protocol.java:2972)
> 
> 
> at oracle.sql.LobDBAccessImpl.getChunkSize(LobDBAccessImpl.java:322)
> 
> 
> at oracle.sql.BLOB.getChunkSize(BLOB.java:478)            
> 
> at oracle.sql.BLOB.getBufferSize(BLOB.java:515)             
> 
> at oracle.sql.BLOB.getBinaryOutputStream(BLOB.java:413)          
> 
> at 
> com.vertex.png.myidea.model.SubmitIdea.InsertIdea(SubmitIdea.java:250)
> 
> 
> at 
> com.vertex.png.myidea.model.submitidea.SubmitMyIdeaAction.exec
> ute(SubmitMyId
> eaAction.java:59)      
> 
> at 
> org.apache.struts.action.RequestProcessor.processActionPerform
> (RequestProces
> sor.java:419)   
> 
> at
> org.apache.struts.action.RequestProcessor.process(RequestProce
> ssor.java:224)
> 
> 
> at 
> org.apache.struts.action.ActionServlet.process(ActionServlet.j
> ava:1196)
> 
> 
> at 
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.ja
> va:432)    
> 
> at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:807)          
> 
> at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:908)          
> 
> at 
> org.apache.catalina.core.StandardWrapperValve.invokeServletSer
> vice(StandardW
> rapperValve.java:771)     
> 
> at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> rapperValve.ja
> va:322)             
> 
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:509)
> 
> 
> at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardC
> ontextValve.ja
> va:212)   
> 
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:509)
> 
> 
> at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> Valve.java:209
> )            
> 
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:509)
> 
> 
> at 
> com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSA
> PIProcessor.ja
> va:161)          
> 
> at com.iplanet.ias.web.WebContainer.service(WebContainer.java:578)
> 
>  
> 
>  
> 
>  
> 
> Application CODE:
> 
>  
> 
> Writing File content in blob
> 
>  
> 
> BLOB byteFile1Content = dmlObj.blbCreation();//temporary lob 
> creation in Dml class
> 
> OutputStream    os1 = byteFile1Content.getBinaryOutputStream();
> 
> os1.write(byteFile1Content.getBytes());
> 
> os1.flush();
> 
>          }
> 
>  
> 
>  
> 
> Getting data Source from struts config
> 
> ServletContext context = request.getSession().getServletContext();
> 
> ModuleConfig moduleConfig = 
> ModuleUtils.getInstance().getModuleConfig(request,context);
> 
> dataSource = 
> (DataSource)context.getAttribute("org.apache.struts.action.DAT
> A_SOURCE"+modu
> leConfig.getPrefix());
> 
>  
> 
> Struts-config
> 
>  
> 
> <data-sources>
> 
>  
> 
>   <data-source type="oracle.jdbc.pool.OracleDataSource">
> 
>   <set-property property="autoCommit" value="false"/>
> 
>   <set-property property="description" value="First Database Config"/>
> 
> <set-property property="driverClass" 
> value="oracle.jdbc.driver.OracleDriver"
> />
> 
> <set-property property="URL" 
> value="jdbc:oracle:thin:@remotehost:1521:SID"
> />
> 
> <set-property property="user" value=" username"/>
> 
> <set-property property="password" value=" password"/>
> 
> <set-property property="maxCount" value="32"/>
> 
> <set-property property="minCount" value="8"/>
> 
> <set-property property="resizeQuantity" value="2"/>
> 
> <set-property property="maxWait" value="60000"/>
> 
> <set-property property="minWait" value="300"/>
> 
>   <set-property property="readCommitted" value="true"/>
> 
>    </data-source>
> 
>  
> 
>   </data-sources>
> 
>  
> 
> Please help 
> 
>  
> 
> Thank You
> 
> Srinivas Vakkalanka
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to