|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
LogDataSource.java | - | 0% | 0% | 0% |
|
1 |
/*
|
|
2 |
* Joey and its relative products are published under the terms
|
|
3 |
* of the Apache Software License.
|
|
4 |
*/
|
|
5 |
/*
|
|
6 |
* Created on 2004/02/25
|
|
7 |
*/
|
|
8 |
package org.asyrinx.brownie.jdbc.logger;
|
|
9 |
|
|
10 |
import java.sql.Connection;
|
|
11 |
import java.sql.SQLException;
|
|
12 |
|
|
13 |
import org.asyrinx.brownie.core.log.CascadeNamedLog;
|
|
14 |
import org.asyrinx.brownie.core.log.DispatchLog;
|
|
15 |
import org.asyrinx.brownie.jdbc.wrapper.DataSourceWrapper;
|
|
16 |
|
|
17 |
/**
|
|
18 |
* @author akima
|
|
19 |
*/
|
|
20 |
public class LogDataSource extends DataSourceWrapper { |
|
21 |
|
|
22 |
/**
|
|
23 |
* @param dataSource
|
|
24 |
*/
|
|
25 | 0 |
public LogDataSource() {
|
26 | 0 |
super();
|
27 |
} |
|
28 |
|
|
29 |
/**
|
|
30 |
* @see org.asyrinx.brownie.jdbc.wrapper.DataSourceWrapper#getConnection()
|
|
31 |
*/
|
|
32 | 0 |
public Connection getConnection() throws SQLException { |
33 | 0 |
return toLogConnection(super.getConnection()); |
34 |
} |
|
35 |
|
|
36 |
/**
|
|
37 |
* @see org.asyrinx.brownie.jdbc.wrapper.DataSourceWrapper#getConnection(java.lang.String,
|
|
38 |
* java.lang.String)
|
|
39 |
*/
|
|
40 | 0 |
public Connection getConnection(String username, String password)
|
41 |
throws SQLException {
|
|
42 | 0 |
return toLogConnection(super.getConnection(username, password)); |
43 |
} |
|
44 |
|
|
45 | 0 |
protected Connection toLogConnection(Connection connection) {
|
46 | 0 |
return LogConnectionFilter.log(connection, this.log); |
47 |
} |
|
48 |
|
|
49 |
private final CascadeNamedLog log = new CascadeNamedLog(this.getClass(), |
|
50 |
DispatchLog.DEFAULT_LEVEL); |
|
51 |
|
|
52 |
/**
|
|
53 |
* @return
|
|
54 |
*/
|
|
55 | 0 |
public String getDefaultLevel() {
|
56 | 0 |
return log.getDefaultLevel();
|
57 |
} |
|
58 |
|
|
59 |
/**
|
|
60 |
* @return
|
|
61 |
*/
|
|
62 | 0 |
public String getLoggerName() {
|
63 | 0 |
return log.getLoggerName();
|
64 |
} |
|
65 |
|
|
66 |
/**
|
|
67 |
* @param string
|
|
68 |
*/
|
|
69 | 0 |
public void setDefaultLevel(String string) { |
70 | 0 |
log.setDefaultLevel(string); |
71 |
} |
|
72 |
|
|
73 |
/**
|
|
74 |
* @param loggerName
|
|
75 |
*/
|
|
76 | 0 |
public void setLoggerName(String loggerName) { |
77 | 0 |
log.setLoggerName(loggerName); |
78 |
} |
|
79 |
|
|
80 |
} |
|