01: /*
02: * Copyright 2002-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.springframework.jdbc.datasource;
18:
19: import java.io.PrintWriter;
20: import java.sql.SQLException;
21:
22: import javax.sql.DataSource;
23:
24: import org.apache.commons.logging.Log;
25: import org.apache.commons.logging.LogFactory;
26:
27: /**
28: * Abstract base class for Spring's DataSource implementations,
29: * taking care of the padding.
30: *
31: * @author Juergen Hoeller
32: * @since 07.05.2003
33: * @see DriverManagerDataSource
34: */
35: public abstract class AbstractDataSource implements DataSource {
36:
37: /** Logger available to subclasses */
38: protected final Log logger = LogFactory.getLog(getClass());
39:
40: /**
41: * Returns 0, indicating to use the default system timeout.
42: */
43: public int getLoginTimeout() throws SQLException {
44: return 0;
45: }
46:
47: /**
48: * Setting a login timeout is not supported.
49: */
50: public void setLoginTimeout(int timeout) throws SQLException {
51: throw new UnsupportedOperationException("setLoginTimeout");
52: }
53:
54: /**
55: * LogWriter methods are not supported.
56: */
57: public PrintWriter getLogWriter() {
58: throw new UnsupportedOperationException("getLogWriter");
59: }
60:
61: /**
62: * LogWriter methods are not supported.
63: */
64: public void setLogWriter(PrintWriter pw) throws SQLException {
65: throw new UnsupportedOperationException("setLogWriter");
66: }
67:
68: }
|