dirkv       01/08/09 04:43:27

  Modified:    src/stores/slidestore/reference JDBCDescriptorsStore.java
  Log:
  extra logging
  
  Revision  Changes    Path
  1.22      +34 -5     
jakarta-slide/src/stores/slidestore/reference/JDBCDescriptorsStore.java
  
  Index: JDBCDescriptorsStore.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCDescriptorsStore.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- JDBCDescriptorsStore.java 2001/08/02 19:30:35     1.21
  +++ JDBCDescriptorsStore.java 2001/08/09 11:43:27     1.22
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCDescriptorsStore.java,v 
1.21 2001/08/02 19:30:35 remm Exp $
  - * $Revision: 1.21 $
  - * $Date: 2001/08/02 19:30:35 $
  + * $Header: 
/home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCDescriptorsStore.java,v 
1.22 2001/08/09 11:43:27 dirkv Exp $
  + * $Revision: 1.22 $
  + * $Date: 2001/08/09 11:43:27 $
    *
    * ====================================================================
    *
  @@ -79,12 +79,14 @@
   import org.apache.slide.security.*;
   import org.apache.slide.lock.*;
   import org.apache.slide.content.*;
  +import org.apache.slide.util.logger.Logger;
   
   /**
    * JDBC 1.0 and 2.0 compliant store implementation.
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>Remy Maucherat</a>
  - * @version $Revision: 1.21 $
  + * @author Dirk Verbeeck
  + * @version $Revision: 1.22 $
    */
   
   public class JDBCDescriptorsStore
  @@ -260,10 +262,12 @@
        */
       public synchronized void connect()
           throws ServiceConnectionFailedException {
  +        getLogger().log("Connecting to \"" + url + "\" as user \"" + user + 
"\"",LOG_CHANNEL,Logger.INFO);
           try {
               connection = DriverManager.getConnection
                   (url, user, password);
           } catch (SQLException e) {
  +            getLogger().log("Connecting to \"" + url + "\" as user \"" + user + "\" 
failed",LOG_CHANNEL,Logger.ERROR);
               throw new ServiceConnectionFailedException(this, e);
           }
           
  @@ -369,25 +373,32 @@
           throws ServiceInitializationFailedException {
           try {
               // Loading and registering driver
  +            token.getLogger().log("Loading and registering driver: " + 
driver,LOG_CHANNEL,Logger.INFO);
               Class driverClass = Class.forName(driver);
               Driver databaseDriver = (Driver) driverClass.newInstance();
               DriverManager.registerDriver(databaseDriver);
           } catch (ClassNotFoundException e) {
  +            token.getLogger().log("Loading and registering driver " + driver + " 
failed",LOG_CHANNEL,Logger.ERROR);
               throw new ServiceInitializationFailedException
                   (this, e.getMessage());
           } catch (InstantiationException e) {
  +            token.getLogger().log("Loading and registering driver " + driver + " 
failed",LOG_CHANNEL,Logger.ERROR);
               throw new ServiceInitializationFailedException
                   (this, e.getMessage());
           } catch (IllegalAccessException e) {
  +            token.getLogger().log("Loading and registering driver " + driver + " 
failed",LOG_CHANNEL,Logger.ERROR);
               throw new ServiceInitializationFailedException
                   (this, e.getMessage());
           } catch (SQLException e) {
  +            token.getLogger().log("Loading and registering driver " + driver + " 
failed",LOG_CHANNEL,Logger.ERROR);
               throw new ServiceInitializationFailedException
                   (this, e.getMessage());
           } catch (ClassCastException e) {
  +            token.getLogger().log("Loading and registering driver " + driver + " 
failed",LOG_CHANNEL,Logger.ERROR);
               throw new ServiceInitializationFailedException
                   (this, e.getMessage());
           } catch (Exception e) {
  +            token.getLogger().log("Loading and registering driver " + driver + " 
failed",LOG_CHANNEL,Logger.ERROR);
               throw new ServiceInitializationFailedException
                   (this, e.getMessage());
           }
  @@ -631,6 +642,7 @@
               }
               
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -716,6 +728,7 @@
               }
               
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -800,6 +813,7 @@
               }
               
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -850,6 +864,7 @@
               closeStatement(statement);
               
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           }
       }
  @@ -891,6 +906,7 @@
               statement.setInt(6, negative);
               statement.execute();
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -928,6 +944,7 @@
                
               statement.execute();
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -954,6 +971,7 @@
               statement.setString(1, uri.toString());
               statement.execute();
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -1000,6 +1018,7 @@
               }
               
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -1043,6 +1062,7 @@
               statement.setInt(7, exclusive);
               statement.execute();
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -1094,6 +1114,7 @@
               statement.execute();
               
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -1129,6 +1150,7 @@
               statement.execute(s);
               
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -1194,6 +1216,7 @@
               }
               
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -1301,6 +1324,7 @@
                    latestRevisionNumbers, branches, isVersioned);
               
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -1367,6 +1391,7 @@
               // TODO
               
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -1432,6 +1457,7 @@
               closeStatement(statement);
               
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -1520,6 +1546,7 @@
                                              labels, properties);
               
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -1599,6 +1626,7 @@
   
               
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -1665,6 +1693,7 @@
               statement.execute();
               
           } catch (SQLException e) {
  +            getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
               throw new ServiceAccessException(this, e);
           } finally {
               closeStatement(statement);
  @@ -1689,4 +1718,4 @@
       }
       
       
  -}
  +}
  \ No newline at end of file
  
  
  

Reply via email to