KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > common > util > Constants


1 /**
2  * C-JDBC: Clustered JDBC.
3  * Copyright (C) 2002-2005 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: c-jdbc@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or any later
10  * version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20  *
21  * Initial developer(s): Nicolas Modrzyk.
22  * Contributor(s): Emmanuel Cecchet.
23  */

24
25 package org.objectweb.cjdbc.common.util;
26
27 /**
28  * Constants that are common to the console, driver and controller modules
29  *
30  * @author <a HREF="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
31  * @author <a HREF="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
32  */

33 public class Constants
34 {
35   /** C-JDBC version. */
36   public static final String JavaDoc VERSION = "@VERSION@";
37
38   /**
39    * C-JDBC major version
40    *
41    * @return major version
42    */

43   public static final int getMajorVersion()
44   {
45     int ind = VERSION.indexOf('.');
46     if (ind > 0)
47       return Integer.parseInt(VERSION.substring(0, ind));
48     else
49       return 1;
50   }
51
52   /**
53    * C-JDBC minor version
54    *
55    * @return minor version
56    */

57   public static final int getMinorVersion()
58   {
59     int ind = VERSION.indexOf('.');
60     if (ind > 0)
61       return Integer.parseInt(VERSION.substring(ind + 1, ind + 2));
62     else
63       return 0;
64   }
65
66   /**
67    * Maximum number of characters to display when a SQL statement is logged into
68    * a Exception.
69    */

70   public static final int SQL_SHORT_FORM_LENGTH = 40;
71
72   /** Shutdown Mode Wait: Wait for all clients to disconnect */
73   public static final int SHUTDOWN_WAIT = 1;
74   /**
75    * Shutdown Mode Safe: Wait for all current transactions to complete before
76    * shutdown
77    */

78   public static final int SHUTDOWN_SAFE = 2;
79   /**
80    * Shutdown Mode Force: Does not wait for the end of the current transactions
81    * and kill all connections. Recovery will be needed on restart.
82    */

83   public static final int SHUTDOWN_FORCE = 3;
84
85   /** C-JDBC DTD file name (must be found in classpath). */
86   public static final String JavaDoc C_JDBC_DTD_FILE = "c-jdbc.dtd";
87
88 }
Popular Tags