Hi,

I've just created the JOnAS specific installation (and running) instructions for the P6Spy software. This is free tool that may be downloaded at http://www.provision6.com and that intercepts and logs all database statements of any application that uses JDBC (as a JOnAS server). This tool has been mentionned by Jeff Goke <[EMAIL PROTECTED]> today in this mailing list.

Best Regards,

François

JOnAS Installation

These instructions have been tested with JOnAS 2.3.x.

  1. Unzip the distribution. Unjar the p6spy-install.jar file.  This contains two files: p6spy.jar and spy.properties
  2. Put the p6spy.jar file in the classpath of the JOnAS EJB server. For example, if p6spy.jar is in the /opt/Provider6 directory, you may add /opt/Provider6/p6psy.jar to the XTRA_CLASSPATH environment variable (or directly edit the config_env script)
  3. Put spy.properties in a directory which is part of your classpath. The best may be to put it in the same directory as your jndi.properties file
  4. Tell JOnAS to use the P6Spy database driver.  Database access configuration within JOnAS is described in a DataSource property file, e.g. Oracle1.properties (see the JOnAS Bean Programmer's Guide for more details). Modify the <datasource>.properties file by replacing the database driver classname by the P6Psy database driver class name in the datasource.classname property. For example the Oracle1.properties file delivered with JOnAS should be updated by replacing oracle.jdbc.driver.OracleDriver by com.p6.engine.spy.P6SpyDriver, it then looks like
  5. datasource.name   jdbc_1
    datasource.description  "Standard jdbc driver for Oracle"
    datasource.url   jdbc:oracle:thin:scott/tiger@maltes:1521:ORA1
    datasource.classname com.p6.engine.spy.P6SpyDriver
    ...
  6. Tell P6Spy about your real database driver.  Modify the spy.properties file and change the realdriver line to reflect your real database driver.  In our example: realdriver = oracle.jdbc.driver.OracleDriver
  7. Installation is complete.  There is nothing else to change. You leave your other datasource properties, e.g. name, url, username, password and so on exactly as they were before you installed P6Spy, the P6Spy driver does all of the work required to pass this information along to your real database driver
  8. Run your application.  Run EJBServer. A spy.log file will be generated in the launching directory
  9. View the log file.  The log file contains a list of all of the database statements that are executed. You can change the location of this file and the nature of its content by using the spy property file (see Property File Settings)
--
==================================================================
François EXERTIER         Evidian (Groupe Bull)
     1, rue de Provence,  BP 208,  38432 Echirolles cedex, FRANCE
     mailto:[EMAIL PROTECTED]
     http://www.evidian.com/jonas  http://www.objectweb.org/jonas
     Tel: +33 (0)4 76 29 71 51  -  Fax:   +33 (0)4 76 29 77 30
==================================================================
  ---- To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "unsubscribe jonas-users". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to