~pbms-core/pbms/async_read

« back to all changes in this revision

Viewing changes to mybs/java/src/com/mysql/jdbc/ReplicationDriver.java

  • Committer: paul-mccullagh
  • Date: 2008-03-26 11:35:17 UTC
  • Revision ID: paul-mccullagh-afb1610c21464a577ae428d72fc725eb986c05a5
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 Copyright (C) 2002-2004 MySQL AB
 
3
 
 
4
 This program is free software; you can redistribute it and/or modify
 
5
 it under the terms of version 2 of the GNU General Public License as 
 
6
 published by the Free Software Foundation.
 
7
 
 
8
 There are special exceptions to the terms and conditions of the GPL 
 
9
 as it is applied to this software. View the full text of the 
 
10
 exception in file EXCEPTIONS-CONNECTOR-J in the directory of this 
 
11
 software distribution.
 
12
 
 
13
 This program is distributed in the hope that it will be useful,
 
14
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
 GNU General Public License for more details.
 
17
 
 
18
 You should have received a copy of the GNU General Public License
 
19
 along with this program; if not, write to the Free Software
 
20
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
21
 
 
22
 
 
23
 
 
24
 */
 
25
package com.mysql.jdbc;
 
26
 
 
27
import java.sql.SQLException;
 
28
 
 
29
/**
 
30
 * The Java SQL framework allows for multiple database drivers. Each driver
 
31
 * should supply a class that implements the Driver interface
 
32
 * 
 
33
 * <p>
 
34
 * The DriverManager will try to load as many drivers as it can find and then
 
35
 * for any given connection request, it will ask each driver in turn to try to
 
36
 * connect to the target URL.
 
37
 * 
 
38
 * <p>
 
39
 * It is strongly recommended that each Driver class should be small and
 
40
 * standalone so that the Driver class can be loaded and queried without
 
41
 * bringing in vast quantities of supporting code.
 
42
 * 
 
43
 * <p>
 
44
 * When a Driver class is loaded, it should create an instance of itself and
 
45
 * register it with the DriverManager. This means that a user can load and
 
46
 * register a driver by doing Class.forName("foo.bah.Driver")
 
47
 * 
 
48
 * @see org.gjt.mm.mysql.Connection
 
49
 * @see java.sql.Driver
 
50
 * @author Mark Matthews
 
51
 * @version $Id: ReplicationDriver.java,v 1.1.2.1 2005/05/13 18:58:38 mmatthews
 
52
 *          Exp $
 
53
 */
 
54
public class ReplicationDriver extends NonRegisteringReplicationDriver
 
55
                implements java.sql.Driver {
 
56
        // ~ Static fields/initializers
 
57
        // ---------------------------------------------
 
58
 
 
59
        //
 
60
        // Register ourselves with the DriverManager
 
61
        //
 
62
        static {
 
63
                try {
 
64
                        java.sql.DriverManager
 
65
                                        .registerDriver(new NonRegisteringReplicationDriver());
 
66
                } catch (SQLException E) {
 
67
                        throw new RuntimeException("Can't register driver!");
 
68
                }
 
69
        }
 
70
 
 
71
        // ~ Constructors
 
72
        // -----------------------------------------------------------
 
73
 
 
74
        /**
 
75
         * Construct a new driver and register it with DriverManager
 
76
         * 
 
77
         * @throws SQLException
 
78
         *             if a database error occurs.
 
79
         */
 
80
        public ReplicationDriver() throws SQLException {
 
81
                // Required for Class.forName().newInstance()
 
82
        }
 
83
}