I.lib()/I.lib(Java)
Spy 설정 방법.
.07274.
2011. 3. 31. 16:00
# SPY 설정 방법.
1. SPY 라이브러리를 복사하여 적용한다.
2. SPY.properties 파일을 설정한다.
realdriver=Altibase.jdbc.driver.AltibaseDriver <-- Driver 설정
log4j.appender.SQL=org.apache.log4j.DailyRollingFileAppender <- Log 설정.
log4j.appender.SQL.layout=org.apache.log4j.PatternLayout
log4j.appender.SQL.datePattern=yyyy-MM-dd
log4j.appender.SQL.layout.ConversionPattern=p6spy - %m%n
log4j.appender.SQL.file=C:/pcas-workspace/logs/pcas-spysql.log
log4j.appender.SQL=org.apache.log4j.DailyRollingFileAppender <- Log 설정.
log4j.appender.SQL.layout=org.apache.log4j.PatternLayout
log4j.appender.SQL.datePattern=yyyy-MM-dd
log4j.appender.SQL.layout.ConversionPattern=p6spy - %m%n
log4j.appender.SQL.file=C:/pcas-workspace/logs/pcas-spysql.log
3. DataSource에 DriverClassName에 SPY Driver 를 설정한다.
ex. META-INF/context.xml
<Context docBase="pcas" path="/pcas" reloadable="true">
<Resource name="jdbc/pcss" auth="Container"
type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
maxActive="20"
maxIdle="10"
maxWait="-1"
username="pcss"
password="pcss123"
driverClassName="com.p6spy.engine.spy.P6SpyDriver"
url="jdbc:Altibase://111.111.111.11:20300/mydb"
removeAbandoned="true"
removeAbandonedTimeout="10"
validationQuery="SELECT 1 FROM dual"
logAbandoned="true"/>
</Context>
<Context docBase="pcas" path="/pcas" reloadable="true">
<Resource name="jdbc/pcss" auth="Container"
type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
maxActive="20"
maxIdle="10"
maxWait="-1"
username="pcss"
password="pcss123"
driverClassName="com.p6spy.engine.spy.P6SpyDriver"
url="jdbc:Altibase://111.111.111.11:20300/mydb"
removeAbandoned="true"
removeAbandonedTimeout="10"
validationQuery="SELECT 1 FROM dual"
logAbandoned="true"/>
</Context>
4. 끝~!