remm        01/03/23 21:10:06

  Modified:    src/stores/slidestore/reference JDBCContentStore.java
                        JDBCDescriptorsStore.java
  Added:       src/stores/slidestore/mysql MySQLContentStore.java
                        MySQLDescriptorsStore.java
  Log:
  - Add MySQL specific stores, with disabled transaction support.
    Untested : please send feedback !
  
  Revision  Changes    Path
  1.1                  jakarta-slide/src/stores/slidestore/mysql/MySQLContentStore.java
  
  Index: MySQLContentStore.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-slide/src/stores/slidestore/mysql/MySQLContentStore.java,v 1.1 
2001/03/24 05:10:03 remm Exp $
   * $Revision: 1.1 $
   * $Date: 2001/03/24 05:10:03 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */
  
  package slidestore.mysql;
  
  import java.lang.reflect.Constructor;
  import java.util.Hashtable;
  import java.util.Enumeration;
  import java.util.Vector;
  import java.util.Date;
  import java.io.FileWriter;
  import java.io.InputStream;
  import java.io.OutputStream;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.InputStreamReader;
  import java.io.IOException;
  import java.io.File;
  import java.sql.*;
  import javax.transaction.xa.XAException;
  import javax.transaction.xa.Xid;
  import org.apache.slide.common.*;
  import org.apache.slide.store.*;
  import org.apache.slide.structure.*;
  import org.apache.slide.security.*;
  import org.apache.slide.content.*;
  import slidestore.reference.JDBCContentStore;
  
  /**
   * MySQL specific implementation of ContentStore. This store should only be
   * used with version 3.22 and older of MySQL.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
   * @version $Revision: 1.1 $
   */
  public class MySQLContentStore extends JDBCContentStore {
      
      
      // -------------------------------------------------------------- Constants
      
      
      // -------------------------------------------------------- Service Methods
      
      
      // ----------------------------------------------------- XAResource Methods
      
      
      /**
       * Commit the global transaction specified by xid.
       */
      public void commit(Xid xid, boolean onePhase)
          throws XAException {
          super.commit(xid, onePhase);
      }
      
      
      /**
       * Inform the resource manager to roll back work done on behalf of a
       * transaction branch.
       */
      public void rollback(Xid xid)
          throws XAException {
          super.rollback(xid);
      }
      
      
      /**
       * Start work on behalf of a transaction branch specified in xid.
       */
      public void start(Xid xid, int flags)
          throws XAException {
          super.start(xid, flags);
      }
      
      
      // --------------------------------------------------- ContentStore Methods
      
      
  }
  
  
  
  1.1                  
jakarta-slide/src/stores/slidestore/mysql/MySQLDescriptorsStore.java
  
  Index: MySQLDescriptorsStore.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-slide/src/stores/slidestore/mysql/MySQLDescriptorsStore.java,v 1.1 
2001/03/24 05:10:04 remm Exp $
   * $Revision: 1.1 $
   * $Date: 2001/03/24 05:10:04 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  
  package slidestore.reference;
  
  import java.lang.reflect.Constructor;
  import java.util.Hashtable;
  import java.util.Enumeration;
  import java.util.Vector;
  import java.util.Date;
  import java.io.FileWriter;
  import java.io.IOException;
  import java.sql.*;
  import javax.transaction.xa.XAException;
  import javax.transaction.xa.Xid;
  import org.apache.slide.common.*;
  import org.apache.slide.store.*;
  import org.apache.slide.structure.*;
  import org.apache.slide.security.*;
  import org.apache.slide.lock.*;
  import org.apache.slide.content.*;
  import slidestore.reference.JDBCDescriptorsStore;
  
  /**
   * MySQL specific implementation of DescriptorsStore. This store should only be
   * used with version 3.22 and older of MySQL.
   * 
   * @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
   * @version $Revision: 1.1 $
   */
  
  public class MySQLDescriptorsStore extends JDBCDescriptorsStore {
      
      
      // -------------------------------------------------------------- Constants
      
      
      // -------------------------------------------------------- Service Methods
      
      
      // ----------------------------------------------------- XAResource Methods
      
      
      /**
       * Commit the global transaction specified by xid.
       */
      public void commit(Xid xid, boolean onePhase)
          throws XAException {
          super.commit(xid, onePhase);
      }
      
      
      /**
       * Inform the resource manager to roll back work done on behalf of a
       * transaction branch.
       */
      public void rollback(Xid xid)
          throws XAException {
          super.rollback(xid);
      }
      
      
      /**
       * Start work on behalf of a transaction branch specified in xid.
       */
      public void start(Xid xid, int flags)
          throws XAException {
          super.start(xid, flags);
      }
      
      
      // ----------------------------------------------- DescriptorsStore Methods
      
      
  }
  
  
  
  1.3       +9 -9      
jakarta-slide/src/stores/slidestore/reference/JDBCContentStore.java
  
  Index: JDBCContentStore.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCContentStore.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JDBCContentStore.java     2001/03/17 18:39:24     1.2
  +++ JDBCContentStore.java     2001/03/24 05:10:04     1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCContentStore.java,v 1.2 
2001/03/17 18:39:24 remm Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/03/17 18:39:24 $
  + * $Header: 
/home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCContentStore.java,v 1.3 
2001/03/24 05:10:04 remm Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/03/24 05:10:04 $
    *
    * ====================================================================
    *
  @@ -89,7 +89,7 @@
    * JDBC 2.0 compliant implementation of ContentStore.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class JDBCContentStore extends AbstractSimpleService
       implements ContentStore {
  @@ -111,31 +111,31 @@
       /**
        * Database connection.
        */
  -    private Connection connection;
  +    protected Connection connection;
       
       
       /**
        * Driver class name.
        */
  -    private String driver;
  +    protected String driver;
       
       
       /**
        * Connection URL.
        */
  -    private String url;
  +    protected String url;
       
       
       /**
        * User name.
        */
  -    private String user;
  +    protected String user;
       
       
       /**
        * Password.
        */
  -    private String password;
  +    protected String password;
       
       
       // -------------------------------------------------------- Service Methods
  
  
  
  1.11      +10 -10    
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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JDBCDescriptorsStore.java 2001/03/17 18:39:24     1.10
  +++ JDBCDescriptorsStore.java 2001/03/24 05:10:05     1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCDescriptorsStore.java,v 
1.10 2001/03/17 18:39:24 remm Exp $
  - * $Revision: 1.10 $
  - * $Date: 2001/03/17 18:39:24 $
  + * $Header: 
/home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCDescriptorsStore.java,v 
1.11 2001/03/24 05:10:05 remm Exp $
  + * $Revision: 1.11 $
  + * $Date: 2001/03/24 05:10:05 $
    *
    * ====================================================================
    *
  @@ -84,7 +84,7 @@
    * JDBC 1.0 and 2.0 compliant store implementation.
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
  - * @version $Revision: 1.10 $
  + * @version $Revision: 1.11 $
    */
   
   public class JDBCDescriptorsStore
  @@ -168,37 +168,37 @@
       /**
        * Database connection.
        */
  -    private Connection connection;
  +    protected Connection connection;
       
       
       /**
        * Driver class name.
        */
  -    private String driver;
  +    protected String driver;
       
       
       /**
        * Connection URL.
        */
  -    private String url;
  +    protected String url;
       
       
       /**
        * User name.
        */
  -    private String user;
  +    protected String user;
       
       
       /**
        * Password.
        */
  -    private String password;
  +    protected String password;
       
       
       /**
        * JDBC Version to use.
        */
  -    private int jdbcVersion;
  +    protected int jdbcVersion;
       
       
       // -------------------------------------------------------- Service Methods
  
  
  

Reply via email to