Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
月轩居士
SkyWalking
提交
bc7afa63
S
SkyWalking
项目概览
月轩居士
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
bc7afa63
编写于
11月 08, 2020
作者:
K
King
提交者:
GitHub
11月 08, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add support for dbcp 2.x plugin (#5550)
上级
1c55781a
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
1102 addition
and
2 deletion
+1102
-2
.github/workflows/plugins-test.3.yaml
.github/workflows/plugins-test.3.yaml
+1
-0
CHANGES.md
CHANGES.md
+1
-0
apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
...walking/apm/network/trace/component/ComponentsDefine.java
+2
-2
apm-sniffer/apm-sdk-plugin/dbcp-2.x-plugin/pom.xml
apm-sniffer/apm-sdk-plugin/dbcp-2.x-plugin/pom.xml
+46
-0
apm-sniffer/apm-sdk-plugin/dbcp-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/dbcp/v2/PoolingCloseConnectInterceptor.java
...ng/apm/plugin/dbcp/v2/PoolingCloseConnectInterceptor.java
+50
-0
apm-sniffer/apm-sdk-plugin/dbcp-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/dbcp/v2/PoolingGetConnectInterceptor.java
...king/apm/plugin/dbcp/v2/PoolingGetConnectInterceptor.java
+50
-0
apm-sniffer/apm-sdk-plugin/dbcp-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/dbcp/v2/define/BasicDataSourceInstrumentation.java
...plugin/dbcp/v2/define/BasicDataSourceInstrumentation.java
+75
-0
apm-sniffer/apm-sdk-plugin/dbcp-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/dbcp/v2/define/DelegatingConnectionInstrumentation.java
...n/dbcp/v2/define/DelegatingConnectionInstrumentation.java
+76
-0
apm-sniffer/apm-sdk-plugin/dbcp-2.x-plugin/src/main/resources/skywalking-plugin.def
.../dbcp-2.x-plugin/src/main/resources/skywalking-plugin.def
+18
-0
apm-sniffer/apm-sdk-plugin/pom.xml
apm-sniffer/apm-sdk-plugin/pom.xml
+1
-0
docs/en/setup/service-agent/java-agent/Plugin-list.md
docs/en/setup/service-agent/java-agent/Plugin-list.md
+1
-0
docs/en/setup/service-agent/java-agent/Supported-list.md
docs/en/setup/service-agent/java-agent/Supported-list.md
+2
-0
oap-server/server-bootstrap/src/main/resources/component-libraries.yml
...rver-bootstrap/src/main/resources/component-libraries.yml
+3
-0
test/plugin/scenarios/dbcp-2.x-scenario/bin/startup.sh
test/plugin/scenarios/dbcp-2.x-scenario/bin/startup.sh
+21
-0
test/plugin/scenarios/dbcp-2.x-scenario/config/expectedData.yaml
...ugin/scenarios/dbcp-2.x-scenario/config/expectedData.yaml
+240
-0
test/plugin/scenarios/dbcp-2.x-scenario/configuration.yml
test/plugin/scenarios/dbcp-2.x-scenario/configuration.yml
+32
-0
test/plugin/scenarios/dbcp-2.x-scenario/pom.xml
test/plugin/scenarios/dbcp-2.x-scenario/pom.xml
+126
-0
test/plugin/scenarios/dbcp-2.x-scenario/src/main/assembly/assembly.xml
...cenarios/dbcp-2.x-scenario/src/main/assembly/assembly.xml
+41
-0
test/plugin/scenarios/dbcp-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/dbcp/Application.java
.../org/apache/skywalking/apm/testcase/dbcp/Application.java
+34
-0
test/plugin/scenarios/dbcp-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/dbcp/MysqlConfig.java
.../org/apache/skywalking/apm/testcase/dbcp/MysqlConfig.java
+57
-0
test/plugin/scenarios/dbcp-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/dbcp/controller/CaseController.java
...ywalking/apm/testcase/dbcp/controller/CaseController.java
+58
-0
test/plugin/scenarios/dbcp-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/dbcp/service/CaseService.java
...che/skywalking/apm/testcase/dbcp/service/CaseService.java
+71
-0
test/plugin/scenarios/dbcp-2.x-scenario/src/main/resources/application.yaml
...ios/dbcp-2.x-scenario/src/main/resources/application.yaml
+23
-0
test/plugin/scenarios/dbcp-2.x-scenario/src/main/resources/jdbc.properties
...rios/dbcp-2.x-scenario/src/main/resources/jdbc.properties
+18
-0
test/plugin/scenarios/dbcp-2.x-scenario/src/main/resources/log4j2.xml
...scenarios/dbcp-2.x-scenario/src/main/resources/log4j2.xml
+30
-0
test/plugin/scenarios/dbcp-2.x-scenario/support-version.list
test/plugin/scenarios/dbcp-2.x-scenario/support-version.list
+25
-0
未找到文件。
.github/workflows/plugins-test.3.yaml
浏览文件 @
bc7afa63
...
...
@@ -70,6 +70,7 @@ jobs:
-
quartz-scheduler-2.x-scenario
-
xxl-job-2.x-scenario
-
thrift-scenario
-
dbcp-2.x-scenario
steps
:
-
uses
:
actions/checkout@v2
with
:
...
...
CHANGES.md
浏览文件 @
bc7afa63
...
...
@@ -17,6 +17,7 @@ Release Notes.
*
Polish tracing context related codes.
*
Add the plugin for async-http-client 2.x
*
Fix NPE in the nutz plugin.
*
Provide Apache Commons DBCP 2.x plugin.
#### OAP-Backend
*
Add the
`@SuperDataset`
annotation for BrowserErrorLog.
...
...
apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
浏览文件 @
bc7afa63
...
...
@@ -187,5 +187,5 @@ public class ComponentsDefine {
public
static
final
OfficialComponent
ASYNC_HTTP_CLIENT
=
new
OfficialComponent
(
102
,
"AsyncHttpClient"
);
}
\ No newline at end of file
public
static
final
OfficialComponent
DBCP
=
new
OfficialComponent
(
103
,
"dbcp"
);
}
apm-sniffer/apm-sdk-plugin/dbcp-2.x-plugin/pom.xml
0 → 100644
浏览文件 @
bc7afa63
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
apm-sdk-plugin
</artifactId>
<groupId>
org.apache.skywalking
</groupId>
<version>
8.3.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
dbcp-2.x-plugin
</artifactId>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<dbcp.version>
2.7.0
</dbcp.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-dbcp2
</artifactId>
<version>
${dbcp.version}
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
apm-sniffer/apm-sdk-plugin/dbcp-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/dbcp/v2/PoolingCloseConnectInterceptor.java
0 → 100755
浏览文件 @
bc7afa63
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.skywalking.apm.plugin.dbcp.v2
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
import
java.lang.reflect.Method
;
/**
* {@link PoolingCloseConnectInterceptor} intercepted the method of DBCP closing/returning connection.
*/
public
class
PoolingCloseConnectInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
AbstractSpan
span
=
ContextManager
.
createLocalSpan
(
"DBCP/Connection/"
+
method
.
getName
());
span
.
setComponent
(
ComponentsDefine
.
DBCP
);
}
@Override
public
Object
afterMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Object
ret
)
throws
Throwable
{
ContextManager
.
stopSpan
();
return
ret
;
}
@Override
public
void
handleMethodException
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Throwable
t
)
{
ContextManager
.
activeSpan
().
errorOccurred
().
log
(
t
);
}
}
apm-sniffer/apm-sdk-plugin/dbcp-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/dbcp/v2/PoolingGetConnectInterceptor.java
0 → 100755
浏览文件 @
bc7afa63
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.skywalking.apm.plugin.dbcp.v2
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
import
java.lang.reflect.Method
;
/**
* {@link PoolingGetConnectInterceptor} intercepted the method of DBCP getting connection.
*/
public
class
PoolingGetConnectInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
AbstractSpan
span
=
ContextManager
.
createLocalSpan
(
"DBCP/Connection/"
+
method
.
getName
());
span
.
setComponent
(
ComponentsDefine
.
DBCP
);
}
@Override
public
Object
afterMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Object
ret
)
throws
Throwable
{
ContextManager
.
stopSpan
();
return
ret
;
}
@Override
public
void
handleMethodException
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Throwable
t
)
{
ContextManager
.
activeSpan
().
errorOccurred
().
log
(
t
);
}
}
apm-sniffer/apm-sdk-plugin/dbcp-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/dbcp/v2/define/BasicDataSourceInstrumentation.java
0 → 100755
浏览文件 @
bc7afa63
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.skywalking.apm.plugin.dbcp.v2.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.StaticMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
/**
* BasicDataSource provides a "one stop shopping" solution for database connection pool solution
* basic requirements. BasicDataSource#getConnection() creates (if necessary) and return a connection.
*/
public
class
BasicDataSourceInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"org.apache.commons.dbcp2.BasicDataSource"
;
private
static
final
String
CONNECT_GET_INTERCEPTOR
=
"org.apache.skywalking.apm.plugin.dbcp.v2.PoolingGetConnectInterceptor"
;
@Override
protected
ClassMatch
enhanceClass
()
{
return
byName
(
ENHANCE_CLASS
);
}
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[
0
];
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]
{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
"getConnection"
);
}
@Override
public
String
getMethodsInterceptor
()
{
return
CONNECT_GET_INTERCEPTOR
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
@Override
public
StaticMethodsInterceptPoint
[]
getStaticMethodsInterceptPoints
()
{
return
new
StaticMethodsInterceptPoint
[
0
];
}
}
apm-sniffer/apm-sdk-plugin/dbcp-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/dbcp/v2/define/DelegatingConnectionInstrumentation.java
0 → 100755
浏览文件 @
bc7afa63
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.skywalking.apm.plugin.dbcp.v2.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.StaticMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
/**
* DBCP use DelegatingConnection which is the delegating implementation of Connection.All of
* the methods from the Connection interface simply check to see that the Connection is active.
* DelegatingConnection#close() close/return connection.
*/
public
class
DelegatingConnectionInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"org.apache.commons.dbcp2.DelegatingConnection"
;
private
static
final
String
CONNECT_CLOSE_INTERCEPTOR
=
"org.apache.skywalking.apm.plugin.dbcp.v2.PoolingCloseConnectInterceptor"
;
@Override
protected
ClassMatch
enhanceClass
()
{
return
byName
(
ENHANCE_CLASS
);
}
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[
0
];
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]
{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
"close"
);
}
@Override
public
String
getMethodsInterceptor
()
{
return
CONNECT_CLOSE_INTERCEPTOR
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
@Override
public
StaticMethodsInterceptPoint
[]
getStaticMethodsInterceptPoints
()
{
return
new
StaticMethodsInterceptPoint
[
0
];
}
}
\ No newline at end of file
apm-sniffer/apm-sdk-plugin/dbcp-2.x-plugin/src/main/resources/skywalking-plugin.def
0 → 100755
浏览文件 @
bc7afa63
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
dbcp-2.x=org.apache.skywalking.apm.plugin.dbcp.v2.define.DelegatingConnectionInstrumentation
dbcp-2.x=org.apache.skywalking.apm.plugin.dbcp.v2.define.BasicDataSourceInstrumentation
\ No newline at end of file
apm-sniffer/apm-sdk-plugin/pom.xml
浏览文件 @
bc7afa63
...
...
@@ -103,6 +103,7 @@
<module>
thrift-plugin
</module>
<module>
httpclient-commons
</module>
<module>
asynchttpclient-2.x-plugin
</module>
<module>
dbcp-2.x-plugin
</module>
</modules>
<packaging>
pom
</packaging>
...
...
docs/en/setup/service-agent/java-agent/Plugin-list.md
浏览文件 @
bc7afa63
...
...
@@ -9,6 +9,7 @@
-
brpc-java
-
canal-1.x
-
cassandra-java-driver-3.x
-
dbcp-2.x
-
dubbo
-
ehcache-2.x
-
elastic-job-2.x
...
...
docs/en/setup/service-agent/java-agent/Supported-list.md
浏览文件 @
bc7afa63
...
...
@@ -106,6 +106,8 @@
*
[
Coroutine
](
https://kotlinlang.org/docs/reference/coroutines-overview.html
)
1.0.1 -> 1.3.x (Optional²)
*
GraphQL
*
[
Graphql
](
https://github.com/graphql-java
)
8.0 -> 15.x
*
Pool
*
[
Apache Commons DBCP
](
https://github.com/apache/commons-dbcp
)
2.x
¹Due to license incompatibilities/restrictions these plugins are hosted and released in 3rd part repository,
go to
[
SkyAPM java plugin extension repository
](
https://github.com/SkyAPM/java-plugin-extensions
)
to get these.
...
...
oap-server/server-bootstrap/src/main/resources/component-libraries.yml
浏览文件 @
bc7afa63
...
...
@@ -338,6 +338,9 @@ thrift-client:
AsyncHttpClient
:
id
:
102
languages
:
Java
dbcp
:
id
:
103
languages
:
Java
# .NET/.NET Core components
# [3000, 4000) for C#/.NET only
...
...
test/plugin/scenarios/dbcp-2.x-scenario/bin/startup.sh
0 → 100755
浏览文件 @
bc7afa63
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
home
=
"
$(
cd
"
$(
dirname
$0
)
"
;
pwd
)
"
java
-jar
${
agent_opts
}
${
home
}
/../libs/dbcp-2.x-scenario.jar &
\ No newline at end of file
test/plugin/scenarios/dbcp-2.x-scenario/config/expectedData.yaml
0 → 100755
浏览文件 @
bc7afa63
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
segmentItems
:
-
serviceName
:
dbcp-2.x-scenario
segmentSize
:
nq
0
segments
:
-
segmentId
:
not
null
spans
:
-
operationName
:
Mysql/JDBI/Connection/close
operationId
:
eq
0
parentSpanId
:
1
spanId
:
2
componentId
:
33
isError
:
false
spanType
:
Exit
peer
:
mysql-server:3306
skipAnalysis
:
false
tags
:
-
{
key
:
db.type
,
value
:
sql
}
-
{
key
:
db.instance
,
value
:
test
}
-
{
key
:
db.statement
,
value
:
'
'
}
-
operationName
:
DBCP/Connection/getConnection
operationId
:
0
parentSpanId
:
0
spanId
:
1
startTime
:
gt
0
endTime
:
gt
0
componentId
:
103
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
-
operationName
:
Mysql/JDBI/Statement/execute
operationId
:
0
parentSpanId
:
0
spanId
:
3
startTime
:
gt
0
endTime
:
gt
0
componentId
:
33
isError
:
false
spanType
:
Exit
peer
:
mysql-server:3306
skipAnalysis
:
false
tags
:
-
{
key
:
db.type
,
value
:
sql
}
-
{
key
:
db.instance
,
value
:
test
}
-
key
:
db.statement
value
:
"
CREATE
TABLE
test_DBCP(
\n
id
VARCHAR(1)
PRIMARY
KEY,
\n
value
VARCHAR(1)
\
\
NOT
NULL)"
-
operationName
:
DBCP/Connection/close
operationId
:
0
parentSpanId
:
0
spanId
:
4
startTime
:
gt
0
endTime
:
gt
0
componentId
:
103
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
-
operationName
:
DBCP/Connection/getConnection
operationId
:
0
parentSpanId
:
0
spanId
:
5
startTime
:
gt
0
endTime
:
gt
0
componentId
:
103
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
-
operationName
:
Mysql/JDBI/Statement/execute
operationId
:
0
parentSpanId
:
0
spanId
:
6
startTime
:
gt
0
endTime
:
gt
0
componentId
:
33
isError
:
false
spanType
:
Exit
peer
:
mysql-server:3306
skipAnalysis
:
false
tags
:
-
{
key
:
db.type
,
value
:
sql
}
-
{
key
:
db.instance
,
value
:
test
}
-
key
:
db.statement
value
:
'
INSERT
INTO
test_DBCP(id,
value)
VALUES(1,1)'
-
operationName
:
DBCP/Connection/close
operationId
:
0
parentSpanId
:
0
spanId
:
7
startTime
:
gt
0
endTime
:
gt
0
componentId
:
103
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
-
operationName
:
DBCP/Connection/getConnection
operationId
:
0
parentSpanId
:
0
spanId
:
8
startTime
:
gt
0
endTime
:
gt
0
componentId
:
103
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
-
operationName
:
Mysql/JDBI/Statement/execute
operationId
:
0
parentSpanId
:
0
spanId
:
9
startTime
:
gt
0
endTime
:
gt
0
componentId
:
33
isError
:
false
spanType
:
Exit
peer
:
mysql-server:3306
skipAnalysis
:
false
tags
:
-
{
key
:
db.type
,
value
:
sql
}
-
{
key
:
db.instance
,
value
:
test
}
-
key
:
db.statement
value
:
'
SELECT
id,
value
FROM
test_DBCP
WHERE
id=1'
-
operationName
:
DBCP/Connection/close
operationId
:
0
parentSpanId
:
0
spanId
:
10
startTime
:
gt
0
endTime
:
gt
0
componentId
:
103
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
-
operationName
:
DBCP/Connection/getConnection
operationId
:
0
parentSpanId
:
0
spanId
:
11
startTime
:
gt
0
endTime
:
gt
0
componentId
:
103
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
-
operationName
:
Mysql/JDBI/Statement/execute
operationId
:
0
parentSpanId
:
0
spanId
:
12
startTime
:
gt
0
endTime
:
gt
0
componentId
:
33
isError
:
false
spanType
:
Exit
peer
:
mysql-server:3306
skipAnalysis
:
false
tags
:
-
{
key
:
db.type
,
value
:
sql
}
-
{
key
:
db.instance
,
value
:
test
}
-
key
:
db.statement
value
:
"
DELETE
FROM
test_DBCP
WHERE
id=1"
-
operationName
:
DBCP/Connection/close
operationId
:
0
parentSpanId
:
0
spanId
:
13
startTime
:
gt
0
endTime
:
gt
0
componentId
:
103
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
-
operationName
:
DBCP/Connection/getConnection
operationId
:
0
parentSpanId
:
0
spanId
:
14
startTime
:
gt
0
endTime
:
gt
0
componentId
:
103
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
-
operationName
:
Mysql/JDBI/Statement/execute
operationId
:
0
parentSpanId
:
0
spanId
:
15
startTime
:
gt
0
endTime
:
gt
0
componentId
:
33
isError
:
false
spanType
:
Exit
peer
:
mysql-server:3306
skipAnalysis
:
false
tags
:
-
{
key
:
db.type
,
value
:
sql
}
-
{
key
:
db.instance
,
value
:
test
}
-
key
:
db.statement
value
:
"
DROP
table
test_DBCP"
-
operationName
:
DBCP/Connection/close
operationId
:
0
parentSpanId
:
0
spanId
:
16
startTime
:
gt
0
endTime
:
gt
0
componentId
:
103
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
-
operationName
:
/dbcp-2.x-scenario/case/dbcp-2.x-scenario
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
gt
0
endTime
:
gt
0
componentId
:
1
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/dbcp-2.x-scenario/case/dbcp-2.x-scenario'
}
-
{
key
:
http.method
,
value
:
GET
}
test/plugin/scenarios/dbcp-2.x-scenario/configuration.yml
0 → 100755
浏览文件 @
bc7afa63
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
type
:
jvm
entryService
:
http://localhost:8080/dbcp-2.x-scenario/case/dbcp-2.x-scenario
healthCheck
:
http://localhost:8080/dbcp-2.x-scenario/case/healthCheck
startScript
:
./bin/startup.sh
environment
:
depends_on
:
-
mysql-server
dependencies
:
mysql-server
:
image
:
mysql:5.7
hostname
:
mysql-server
expose
:
-
"
3306"
environment
:
-
MYSQL_ROOT_PASSWORD=root
-
MYSQL_DATABASE=test
test/plugin/scenarios/dbcp-2.x-scenario/pom.xml
0 → 100755
浏览文件 @
bc7afa63
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<groupId>
org.apache.skywalking.apm.testcase
</groupId>
<artifactId>
dbcp-2.x-scenario
</artifactId>
<version>
1.0.0
</version>
<packaging>
jar
</packaging>
<modelVersion>
4.0.0
</modelVersion>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<compiler.version>
1.8
</compiler.version>
<test.framework.version>
2.7.0
</test.framework.version>
<docker.image.version>
${test.framework.version}
</docker.image.version>
<spring-boot-version>
2.1.6.RELEASE
</spring-boot-version>
</properties>
<name>
skywalking-dbcp-2.x-scenario
</name>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
${spring-boot-version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-logging
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-log4j2
</artifactId>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
5.1.25
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-dbcp2
</artifactId>
<version>
${test.framework.version}
</version>
</dependency>
</dependencies>
<build>
<finalName>
dbcp-2.x-scenario
</finalName>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
${compiler.version}
</source>
<target>
${compiler.version}
</target>
<encoding>
${project.build.sourceEncoding}
</encoding>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<executions>
<execution>
<id>
assemble
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
<configuration>
<descriptors>
<descriptor>
src/main/assembly/assembly.xml
</descriptor>
</descriptors>
<outputDirectory>
./target/
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
test/plugin/scenarios/dbcp-2.x-scenario/src/main/assembly/assembly.xml
0 → 100755
浏览文件 @
bc7afa63
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<assembly
xmlns=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"
>
<formats>
<format>
zip
</format>
</formats>
<fileSets>
<fileSet>
<directory>
./bin
</directory>
<fileMode>
0775
</fileMode>
</fileSet>
</fileSets>
<files>
<file>
<source>
${project.build.directory}/dbcp-2.x-scenario.jar
</source>
<outputDirectory>
./libs
</outputDirectory>
<fileMode>
0775
</fileMode>
</file>
</files>
</assembly>
test/plugin/scenarios/dbcp-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/dbcp/Application.java
0 → 100755
浏览文件 @
bc7afa63
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.testcase.dbcp
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
try
{
SpringApplication
.
run
(
Application
.
class
,
args
);
}
catch
(
Exception
e
)
{
// Never do this
}
}
}
test/plugin/scenarios/dbcp-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/dbcp/MysqlConfig.java
0 → 100755
浏览文件 @
bc7afa63
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.testcase.dbcp
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.Properties
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
public
class
MysqlConfig
{
private
static
Logger
logger
=
LogManager
.
getLogger
(
MysqlConfig
.
class
);
private
static
String
url
;
private
static
String
userName
;
private
static
String
password
;
static
{
InputStream
inputStream
=
MysqlConfig
.
class
.
getClassLoader
().
getResourceAsStream
(
"/jdbc.properties"
);
Properties
properties
=
new
Properties
();
try
{
properties
.
load
(
inputStream
);
}
catch
(
IOException
e
)
{
logger
.
error
(
"Failed to load config"
,
e
);
}
url
=
properties
.
getProperty
(
"mysql.url"
);
userName
=
properties
.
getProperty
(
"mysql.username"
);
password
=
properties
.
getProperty
(
"mysql.password"
);
}
public
static
String
getUrl
()
{
return
url
;
}
public
static
String
getUserName
()
{
return
userName
;
}
public
static
String
getPassword
()
{
return
password
;
}
}
test/plugin/scenarios/dbcp-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/dbcp/controller/CaseController.java
0 → 100755
浏览文件 @
bc7afa63
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.testcase.dbcp.controller
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.skywalking.apm.testcase.dbcp.service.CaseService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/case"
)
public
class
CaseController
{
@Autowired
CaseService
caseService
;
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
CaseController
.
class
);
private
static
final
String
SUCCESS
=
"Success"
;
@RequestMapping
(
"/dbcp-2.x-scenario"
)
@ResponseBody
public
String
testcase
()
throws
Exception
{
try
{
caseService
.
testCase
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"Failed to execute sql."
,
e
);
throw
e
;
}
return
SUCCESS
;
}
@RequestMapping
(
"/healthCheck"
)
@ResponseBody
public
String
healthCheck
()
throws
Exception
{
return
SUCCESS
;
}
}
test/plugin/scenarios/dbcp-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/dbcp/service/CaseService.java
0 → 100644
浏览文件 @
bc7afa63
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.testcase.dbcp.service
;
import
org.apache.commons.dbcp2.BasicDataSourceFactory
;
import
org.apache.skywalking.apm.testcase.dbcp.MysqlConfig
;
import
org.springframework.stereotype.Service
;
import
javax.sql.DataSource
;
import
java.sql.Connection
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.util.Properties
;
@Service
public
class
CaseService
{
public
static
DataSource
ds
;
private
static
final
String
CREATE_TABLE_SQL
=
"CREATE TABLE test_DBCP(\n"
+
"id VARCHAR(1) PRIMARY KEY, \n"
+
"value VARCHAR(1) NOT NULL)"
;
private
static
final
String
INSERT_DATA_SQL
=
"INSERT INTO test_DBCP(id, value) VALUES(1,1)"
;
private
static
final
String
QUERY_DATA_SQL
=
"SELECT id, value FROM test_DBCP WHERE id=1"
;
private
static
final
String
DELETE_DATA_SQL
=
"DELETE FROM test_DBCP WHERE id=1"
;
private
static
final
String
DROP_TABLE_SQL
=
"DROP table test_DBCP"
;
static
{
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
"driverClassName"
,
"com.mysql.jdbc.Driver"
);
properties
.
setProperty
(
"url"
,
MysqlConfig
.
getUrl
());
properties
.
setProperty
(
"username"
,
MysqlConfig
.
getUserName
());
properties
.
setProperty
(
"password"
,
MysqlConfig
.
getPassword
());
try
{
ds
=
BasicDataSourceFactory
.
createDataSource
(
properties
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
public
void
testCase
()
{
sqlExecutor
(
CREATE_TABLE_SQL
);
sqlExecutor
(
INSERT_DATA_SQL
);
sqlExecutor
(
QUERY_DATA_SQL
);
sqlExecutor
(
DELETE_DATA_SQL
);
sqlExecutor
(
DROP_TABLE_SQL
);
}
public
void
sqlExecutor
(
String
sql
)
{
try
(
Connection
conn
=
ds
.
getConnection
())
{
Statement
statement
=
conn
.
createStatement
();
statement
.
execute
(
sql
);
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
}
}
test/plugin/scenarios/dbcp-2.x-scenario/src/main/resources/application.yaml
0 → 100755
浏览文件 @
bc7afa63
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
server
:
port
:
8080
servlet
:
context-path
:
/dbcp-2.x-scenario
logging
:
config
:
classpath:log4j2.xml
\ No newline at end of file
test/plugin/scenarios/dbcp-2.x-scenario/src/main/resources/jdbc.properties
0 → 100755
浏览文件 @
bc7afa63
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
mysql.url
=
jdbc:mysql://mysql-server:3306/test?serverTimezone=CST
mysql.username
=
root
mysql.password
=
root
test/plugin/scenarios/dbcp-2.x-scenario/src/main/resources/log4j2.xml
0 → 100755
浏览文件 @
bc7afa63
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<Configuration
status=
"WARN"
>
<Appenders>
<Console
name=
"Console"
target=
"SYSTEM_ERR"
>
<PatternLayout
charset=
"UTF-8"
pattern=
"[%d{yyyy-MM-dd HH:mm:ss:SSS}] [%p] - %l - %m%n"
/>
</Console>
</Appenders>
<Loggers>
<Root
level=
"WARN"
>
<AppenderRef
ref=
"Console"
/>
</Root>
</Loggers>
</Configuration>
\ No newline at end of file
test/plugin/scenarios/dbcp-2.x-scenario/support-version.list
0 → 100755
浏览文件 @
bc7afa63
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
2.8.0
2.7.0
2.6.0
2.5.0
2.4.0
2.3.0
2.2.0
2.1.1
2.0.1
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录