Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

Constants.java

00001 /**
00002  * C-JDBC: Clustered JDBC.
00003  * Copyright (C) 2002-2005 French National Institute For Research In Computer
00004  * Science And Control (INRIA).
00005  * Contact: c-jdbc@objectweb.org
00006  * 
00007  * This library is free software; you can redistribute it and/or modify it
00008  * under the terms of the GNU Lesser General Public License as published by the
00009  * Free Software Foundation; either version 2.1 of the License, or any later
00010  * version.
00011  * 
00012  * This library is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
00015  * for more details.
00016  * 
00017  * You should have received a copy of the GNU Lesser General Public License
00018  * along with this library; if not, write to the Free Software Foundation,
00019  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00020  *
00021  * Initial developer(s): Nicolas Modrzyk.
00022  * Contributor(s): Emmanuel Cecchet.
00023  */
00024 
00025 package org.objectweb.cjdbc.common.util;
00026 
00027 /**
00028  * Constants that are common to the console, driver and controller modules
00029  * 
00030  * @author <a href="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
00031  * @author <a href="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
00032  */
00033 public class Constants
00034 {
00035   /** C-JDBC version. */
00036   public static final String VERSION = "@VERSION@";
00037 
00038   /**
00039    * C-JDBC major version
00040    * 
00041    * @return major version
00042    */
00043   public static final int getMajorVersion()
00044   {
00045     int ind = VERSION.indexOf('.');
00046     if (ind > 0)
00047       return Integer.parseInt(VERSION.substring(0, ind));
00048     else
00049       return 1;
00050   }
00051 
00052   /**
00053    * C-JDBC minor version
00054    * 
00055    * @return minor version
00056    */
00057   public static final int getMinorVersion()
00058   {
00059     int ind = VERSION.indexOf('.');
00060     if (ind > 0)
00061       return Integer.parseInt(VERSION.substring(ind + 1, ind + 2));
00062     else
00063       return 0;
00064   }
00065 
00066   /**
00067    * Maximum number of characters to display when a SQL statement is logged into
00068    * a Exception.
00069    */
00070   public static final int    SQL_SHORT_FORM_LENGTH = 40;
00071 
00072   /** Shutdown Mode Wait: Wait for all clients to disconnect */
00073   public static final int    SHUTDOWN_WAIT         = 1;
00074   /**
00075    * Shutdown Mode Safe: Wait for all current transactions to complete before
00076    * shutdown
00077    */
00078   public static final int    SHUTDOWN_SAFE         = 2;
00079   /**
00080    * Shutdown Mode Force: Does not wait for the end of the current transactions
00081    * and kill all connections. Recovery will be needed on restart.
00082    */
00083   public static final int    SHUTDOWN_FORCE        = 3;
00084 
00085   /** CJDBC extension for zipped file names */
00086   public static final String ZIP_EXT               = ".zip";
00087 
00088   /** C-JDBC DTD file name (must be found in classpath). */
00089   public static final String C_JDBC_DTD_FILE       = "c-jdbc.dtd";
00090 
00091 }

Generated on Mon Apr 11 22:01:30 2005 for C-JDBC by  doxygen 1.3.9.1