P6SPY ?

It's dead easy to use; p6SPY is a "wrapper" jdbc driver.
a) Ensure p6spy.jar is in the classpath, as well as the 
b) find spy.properties in the OJB distribution - it's about somewhere. Copy
it, and place it on the classpath - actually, with the version of p6spy
distributed with OJB, we've found that we often have to place it in the
"current directory" e.g. tomcat/bin
c)  in spy.properties replace "realdriver=???" with
"realdriver=oracle.jdbc.driver.OracleDriver"
d) change the connection descriptor like this :

 <jdbc-connection-descriptor
...
       driver="com.p6spy.engine.spy.P6SpyDriver"
   ...
       batch-mode="false">

And "bob's your uncle".

Basically, all this does is change the jdbc descriptor to point to the p6spy
driver, and the p6spy driver to point to oracle. So, all the jdbc calls are
delgated to p6spy, which are then logged. It's wonderfully simple, and
terrifically useful.

More about p6spy can be found here : 
http://www.p6spy.com/


Note : the latest version currently available on the p6spy website appears
to be terribly buggy; I suggest sticking to the one distributed with OJB.

Cheers,

Charles.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: 27 October 2003 07:23
> To: OJB Users List
> Subject: Re: AW: Character set mismatch error in Oracle
> 
> 
> 
> 
> 
> 
> Could any one give me a hand on this one ?
> 
> Patrick Reyes
> ----- Forwarded by Patrick Reyes/CDS/CG/CAPITAL on 10/27/2003 08:22 AM
> -----
>                                                               
>                                                               
>            
>                       Patrick Reyes                           
>                                                               
>            
>                                                To:      "OJB 
> Users List" <[EMAIL PROTECTED]>                          
>             
>                       10/23/2003 07:57         cc:      "OJB 
> Users List" <[EMAIL PROTECTED]>                          
>             
>                       AM                       Subject: Re: 
> AW: Character set mismatch error in Oracle(Document link: 
> Patrick Reyes)   
>                                                               
>                                                               
>            
>                                                               
>                                                               
>            
> 
> 
> 
> Yep, sorry I forgot to include this information here it is:
> 
> <descriptor-repository version="1.0" 
> isolation-level="read-uncommitted">
> <jdbc-connection-descriptor
>       jcd-alias=""
>       default-connection="true"
>       platform="Oracle"
>       jdbc-level="2.0"
>       driver="oracle.jdbc.driver.OracleDriver"
>       protocol="jdbc"
>       subprotocol="oracle:thin"
>       dbalias="@gvo2appd12:1521:EFAX817"
>       username="***"
>       password="***"
>       batch-mode="false"
> >
>   <connection-pool maxActive="21" validationQuery="" />
>   <sequence-manager
> className="org.apache.ojb.broker.util.sequence.SequenceManager
> HighLowImpl">
>     <attribute attribute-name="grabSize" attribute-value="1"/>
>   </sequence-manager>
> </jdbc-connection-descriptor>
> 
> - with which character set did you create your database
> 
> The database was created by our DBA, but he is out for the 
> week :-(  How do
> I check this ?
> 
> - how does the CREATE TABLE statement look like (esp. the 
> datatype in the
> database)
> 
> CREATE TABLE EFAX.MESSAGE
>   (ID INTEGER NOT NULL,
>    CONTENT NVARCHAR2(1) NOT NULL,
>    STATUS INTEGER NOT NULL,
>    CREATION_DATE DATE NOT NULL,
>    MODIFICATION_DATE DATE NOT NULL);
> 
> - (well, and maybe the p6spy output of the actual statement 
> sent to the
> database=
> 
> If only I knew how to use p6spy I would ? Where can I find 
> doc on this tool
> ?
> 
> Thanks and regards,
> 
> Patrick Reyes
> 
> 
>                                                               
>                                                               
>            
>                       "Geigl                                  
>                                                               
>            
>                       Maximilian, R235"        To:       "OJB 
> Users List" <[EMAIL PROTECTED]>                          
>            
>                       <Geigl.Maximilian        cc:       
> (bcc: Patrick Reyes/CDS/CG/CAPITAL)                           
>                 
>                       @akdb.de>                Subject:  AW: 
> Character set mismatch error in Oracle                        
>             
>                                                               
>                                                               
>            
>                       10/22/2003 05:53                        
>                                                               
>            
>                       PM                                      
>                                                               
>            
>                       Please respond to                       
>                                                               
>            
>                       "OJB Users List"                        
>                                                               
>            
>                                                               
>                                                               
>            
>                                                               
>                                                               
>            
> 
> 
> 
> 
> Hi,
> 
> can you tell, which
> - jdbc driver you use (THIN or the one that uses Oracle Net) 
> - maybe the
> connection
>   descriptor wourd be helpful
> - with which character set did you create your database
> - how does the CREATE TABLE statement look like (esp. the 
> datatype in the
> database)
> - (well, and maybe the p6spy output of the actual statement 
> sent to the
> database=
> 
> Max
> 
> > -----Ursprüngliche Nachricht-----
> > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Gesendet: Mittwoch, 22. Oktober 2003 15:38
> > An: [EMAIL PROTECTED]
> > Betreff: Character set mismatch error in Oracle
> >
> >
> >
> >
> >
> >
> > I am trying to access an Oracle 8i DB via OJB.
> >
> > Here is my repository def:
> >
> > <!-- This repository file is generated by the impart OJB 
> Generator -->
> > <!--           www.impart.ch [EMAIL PROTECTED]                 
>        -->
> > <!--        created at 22 Oct 2003 12:37:29 GMT               
> >       -->
> >
> >
> > <!-- Definitions for .EFAX -->
> > <class-descriptor
> >   class="com.capgroup.mo.transport.Message"
> >   table="EFAX.MESSAGE"
> > >
> >   <field-descriptor id="0"
> >     name="id"
> >     column="ID"
> >     jdbc-type="INTEGER"
> >     primarykey="true"
> >   />
> >   <field-descriptor id="1"
> >     name="content"
> >     column="CONTENT"
> >     jdbc-type="VARCHAR"
> >   />
> >   <field-descriptor id="2"
> >     name="status"
> >     column="STATUS"
> >     jdbc-type="INTEGER"
> >   />
> >   <field-descriptor id="3"
> >     name="creation_date"
> >     column="CREATION_DATE"
> >     jdbc-type="DATE"
> >       conversion =
> > "org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlDat
> > eFieldConversion"
> >
> >   />
> >   <field-descriptor id="4"
> >     name="modification_date"
> >     column="MODIFICATION_DATE"
> >     jdbc-type="DATE"
> >       conversion =
> > "org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlDat
> > eFieldConversion"
> >
> >   />
> >
> > </class-descriptor>
> >
> > And here is my class:
> >
> > // Generated by impart OJB Generator
> > // www.impart.ch [EMAIL PROTECTED]
> > // created at 22 Oct 2003 12:37:30 GMT
> >
> > package com.capgroup.mo.transport;
> >
> > import java.util.Date;
> > //import java.sql.*;
> >
> > public class Message
> > {
> >
> >   private Object content;
> >   private Date creation_date;
> >   private long id;
> >   private Date modification_date;
> >   private long status;
> >
> >
> >
> >   public Object getContent()
> >   {
> >      return this.content;
> >   }
> >   public void setContent(Object param)
> >   {
> >     this.content = param;
> >   }
> >
> >
> >   public Date getCreation_date()
> >   {
> >      return this.creation_date;
> >   }
> >   public void setCreation_date(Date param)
> >   {
> >     this.creation_date = param;
> >   }
> >
> >
> >   public long getId()
> >   {
> >      return this.id;
> >   }
> >   public void setId(long param)
> >   {
> >     this.id = param;
> >   }
> >
> >
> >   public Date getModification_date()
> >   {
> >      return this.modification_date;
> >   }
> >   public void setModification_date(Date param)
> >   {
> >     this.modification_date = param;
> >   }
> >
> >
> >   public long getStatus()
> >   {
> >      return this.status;
> >   }
> >   public void setStatus(long param)
> >   {
> >     this.status = param;
> >   }
> >
> >
> >   public String toString(){
> >     return  " [CONTENT] " + content + " [CREATION_DATE] " +
> > creation_date +
> > " [ID] " + id + " [MODIFICATION_DATE] " + modification_date +
> > " [STATUS] "
> > + status;
> >
> >   }
> > /*  public IValueObject copy(IValueObject vo){
> >     Message tmp = (Message) vo;
> >     if(vo==null) return this;
> >
> >     setContent(tmp.getContent());
> >     setCreation_date(tmp.getCreation_date());
> >     setId(tmp.getId());
> >     setModification_date(tmp.getModification_date());
> >     setStatus(tmp.getStatus());
> >
> >     return this;
> >   }*/
> > }
> >
> > I am getting the following error:
> >
> > SQL:INSERT INTO EFAX.MESSAGE
> > (ID,CONTENT,STATUS,CREATION_DATE,MODIFICATION_DATE) VALUES 
> (?,?,?,?,?)
> > executeInsert: [EMAIL PROTECTED]
> > SQLException during the execution of the insert (for a
> > com.capgroup.mo.transport.Message): ORA-12704: character 
> set mismatch
> >
> > java.sql.SQLException: ORA-12704: character set mismatch
> >
> >       at 
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
> >       at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java)
> >       at oracle.jdbc.ttc7.Oall7.receive(Oall7.java)
> >       at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java)
> >       at
> > oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java)
> >       at
> > oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleState
> > ment.java)
> >       at
> > oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatem
> > ent.java)
> >       at
> > oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleSt
> > atement.java)
> >       at
> > oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java)
> >       at
> > oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(Oracle
> > Statement.java)
> >       at
> > oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(Oracl
> > ePreparedStatement.java)
> >       at
> > 
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown
> > Source)
> >       at
> > org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
> > Source)
> >       at
> > org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> > Sourc e)
> >       at
> > org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> > Source)
> >       at
> > org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > Source)
> >       at
> > org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > Source)
> >       at
> > com.capgroup.mo.transport.test.TestMessage.main(TestMessage.java:37)
> > closeResources was called
> > java.sql.SQLException: ORA-12704: character set mismatch
> >       at 
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
> >       at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java)
> >       at oracle.jdbc.ttc7.Oall7.receive(Oall7.java)
> >       at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java)
> >       at
> > oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java)
> >       at
> > oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleState
> > ment.java)
> >       at
> > oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatem
> > ent.java)
> >       at
> > oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleSt
> > atement.java)
> >       at
> > oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java)
> >       at
> > oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(Oracle
> > Statement.java)
> >       at
> > oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(Oracl
> > ePreparedStatement.java)
> >       at
> > 
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown
> > Source)
> >       at
> > org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
> > Source)
> >       at
> > org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> > Source)
> >       at
> > org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> > Source)
> >       at
> > org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > Source)
> >       at
> > org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > Source)
> >       at
> > com.capgroup.mo.transport.test.TestMessage.main(TestMessage.java:37)
> > rethrown as
> > org.apache.ojb.broker.PersistenceBrokerSQLException: ORA-12704:
> > character set mismatch
> >       at
> > 
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown
> > Source)
> >       at
> > org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
> > Source)
> >       at
> > org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> > Source)
> >       at
> > org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> > Source)
> >       at
> > org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > Source)
> >       at
> > org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> > Source)
> >       at
> > com.capgroup.mo.transport.test.TestMessage.main(TestMessage.java:37)
> >
> > If someone already had a similar error, I would really 
> appreciate some
> > help,
> >
> > Regards,
> >
> > Patrick Reyes
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


This email and any attachments are strictly confidential and are intended
solely for the addressee. If you are not the intended recipient you must
not disclose, forward, copy or take any action in reliance on this message
or its attachments. If you have received this email in error please notify
the sender as soon as possible and delete it from your computer systems.
Any views or opinions presented are solely those of the author and do not
necessarily reflect those of HPD Software Limited or its affiliates.

 At present the integrity of email across the internet cannot be guaranteed
and messages sent via this medium are potentially at risk.  All liability
is excluded to the extent permitted by law for any claims arising as a re-
sult of the use of this medium to transmit information by or to 
HPD Software Limited or its affiliates.



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

Reply via email to