KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quartz > impl > jdbcjobstore > DB2v8Delegate


1 /*
2  * Copyright 2004-2005 OpenSymphony
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy
6  * of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations
14  * under the License.
15  *
16  */

17 package org.quartz.impl.jdbcjobstore;
18
19 import java.sql.PreparedStatement JavaDoc;
20 import java.sql.SQLException JavaDoc;
21
22 import org.apache.commons.logging.Log;
23
24 /**
25  * Quartz JDBC delegate for DB2 v8 databases.
26  * <p>
27  * This differs from the <code>StdJDBCDelegate</code> in that it stores
28  * <code>boolean</code> values in an <code>integer</code> column.
29  * </p>
30  *
31  * @author Blair Jensen
32  */

33 public class DB2v8Delegate extends StdJDBCDelegate {
34
35     public DB2v8Delegate(Log logger, String JavaDoc tablePrefix, String JavaDoc instanceId) {
36         super(logger, tablePrefix, instanceId);
37     }
38
39     public DB2v8Delegate(Log log, String JavaDoc tablePrefix, String JavaDoc instanceId,
40             Boolean JavaDoc useProperties) {
41         super(log, tablePrefix, instanceId, useProperties);
42     }
43
44     /**
45      * Sets the designated parameter to the given Java <code>boolean</code> value.
46      * This translates the boolean to 1/0 for true/false.
47      */

48     protected void setBoolean(PreparedStatement JavaDoc ps, int index, boolean val) throws SQLException JavaDoc {
49         ps.setInt(index, ((val) ? 1 : 0));
50     }
51 }
52
Popular Tags