diff --git a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/Constants.java b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/Constants.java
new file mode 100644
index 000000000..3a4e72de0
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/Constants.java
@@ -0,0 +1,30 @@
+/*
+ * 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.jdbc.oracle;
+
+/**
+ * Constants variables
+ *
+ * @author zhang xin
+ */
+public final class Constants {
+ public static final String STATEMENT_INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.jdbc.oracle.StatementExecuteMethodsInterceptor";
+
+ public static final String PREPARED_STATEMENT_INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.jdbc.oracle.PreparedStatementExecuteMethodsInterceptor";
+}
diff --git a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/oracle/jdbc/driver/JDBCPrepareStatementWithArrayInterceptor.java b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/CreateCallableInterceptor.java
similarity index 55%
rename from apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/oracle/jdbc/driver/JDBCPrepareStatementWithArrayInterceptor.java
rename to apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/CreateCallableInterceptor.java
index 06ccae6d6..d526ac506 100644
--- a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/oracle/jdbc/driver/JDBCPrepareStatementWithArrayInterceptor.java
+++ b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/CreateCallableInterceptor.java
@@ -16,26 +16,16 @@
*
*/
-package oracle.jdbc.driver;
+package org.apache.skywalking.apm.plugin.jdbc.oracle;
import java.lang.reflect.Method;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
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.plugin.jdbc.define.StatementEnhanceInfos;
import org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
-import org.apache.skywalking.apm.plugin.jdbc.trace.SWPreparedStatement;
-/**
- * {@link JDBCPrepareStatementWithArrayInterceptor} return {@link SWPreparedStatement} instance that wrapper the real
- * preparedStatement instance when the client call oracle.jdbc.driver.PhysicalConnection#prepareStatement(String,
- * int[]) method or oracle.jdbc.driver.PhysicalConnection#prepareStatement(String, String[])
- * method.
- *
- * @author zhangxin
- */
-public class JDBCPrepareStatementWithArrayInterceptor implements InstanceMethodsAroundInterceptor {
+public class CreateCallableInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes,
MethodInterceptResult result) throws Throwable {
@@ -45,19 +35,10 @@ public class JDBCPrepareStatementWithArrayInterceptor implements InstanceMethods
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes,
Object ret) throws Throwable {
- /**
- * To prevent the org.postgresql.jdbc.prepareStatement(String sql) method from repeating
- * interceptor, Because PGConnection call org.postgresql.jdbc.prepareStatement(String sql) method when
- * the second argument is empty.
- *
- * @see oracle.jdbc.driver.PhysicalConnection#prepareStatement(String, int[])
- * @see oracle.jdbc.driver.PhysicalConnection#prepareStatement(String, String[])
- **/
- String sql = (String)allArguments[0];
- if (!AutoKeyInfo.isInsertSqlStmt(sql)) {
- return ret;
+ if (ret instanceof EnhancedInstance) {
+ ((EnhancedInstance)ret).setSkyWalkingDynamicField(new StatementEnhanceInfos((ConnectionInfo)objInst.getSkyWalkingDynamicField(), (String)allArguments[0], "CallableStatement"));
}
- return new SWPreparedStatement((Connection)objInst, (PreparedStatement)ret, (ConnectionInfo)objInst.getSkyWalkingDynamicField(), (String)allArguments[0]);
+ return ret;
}
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
diff --git a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/CreatePreparedStatementInterceptor.java b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/CreatePreparedStatementInterceptor.java
new file mode 100644
index 000000000..9c8a2ba3b
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/CreatePreparedStatementInterceptor.java
@@ -0,0 +1,47 @@
+/*
+ * 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.jdbc.oracle;
+
+import java.lang.reflect.Method;
+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.plugin.jdbc.define.StatementEnhanceInfos;
+import org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
+
+public class CreatePreparedStatementInterceptor implements InstanceMethodsAroundInterceptor {
+ @Override
+ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes,
+ MethodInterceptResult result) throws Throwable {
+ }
+
+ @Override
+ public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes,
+ Object ret) throws Throwable {
+ if (ret instanceof EnhancedInstance) {
+ ((EnhancedInstance)ret).setSkyWalkingDynamicField(new StatementEnhanceInfos((ConnectionInfo)objInst.getSkyWalkingDynamicField(), (String)allArguments[0], "PreparedStatement"));
+ }
+ return ret;
+ }
+
+ @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
+ Class>[] argumentsTypes, Throwable t) {
+
+ }
+}
diff --git a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/CreateStatementInterceptor.java b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/CreateStatementInterceptor.java
new file mode 100644
index 000000000..ea2b95cad
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/CreateStatementInterceptor.java
@@ -0,0 +1,47 @@
+/*
+ * 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.jdbc.oracle;
+
+import java.lang.reflect.Method;
+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.plugin.jdbc.define.StatementEnhanceInfos;
+import org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
+
+public class CreateStatementInterceptor implements InstanceMethodsAroundInterceptor {
+ @Override
+ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes,
+ MethodInterceptResult result) throws Throwable {
+ }
+
+ @Override
+ public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes,
+ Object ret) throws Throwable {
+ if (ret instanceof EnhancedInstance) {
+ ((EnhancedInstance)ret).setSkyWalkingDynamicField(new StatementEnhanceInfos((ConnectionInfo)objInst.getSkyWalkingDynamicField(), "", "Statement"));
+ }
+ return ret;
+ }
+
+ @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
+ Class>[] argumentsTypes, Throwable t) {
+
+ }
+}
diff --git a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/PreparedStatementExecuteMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/PreparedStatementExecuteMethodsInterceptor.java
new file mode 100644
index 000000000..065333931
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/PreparedStatementExecuteMethodsInterceptor.java
@@ -0,0 +1,74 @@
+/*
+ * 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.jdbc.oracle;
+
+import java.lang.reflect.Method;
+import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.context.tag.Tags;
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
+import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
+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.plugin.jdbc.define.StatementEnhanceInfos;
+import org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
+
+/**
+ * @author zhang xin
+ */
+public class PreparedStatementExecuteMethodsInterceptor implements InstanceMethodsAroundInterceptor {
+
+ @Override
+ public final void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
+ Class>[] argumentsTypes,
+ MethodInterceptResult result) throws Throwable {
+ StatementEnhanceInfos cacheObject = (StatementEnhanceInfos)objInst.getSkyWalkingDynamicField();
+ ConnectionInfo connectInfo = cacheObject.getConnectionInfo();
+
+ AbstractSpan span = ContextManager.createExitSpan(buildOperationName(connectInfo, method.getName(), cacheObject.getStatementName()), connectInfo.getDatabasePeer());
+ Tags.DB_TYPE.set(span, "sql");
+ Tags.DB_INSTANCE.set(span, connectInfo.getDatabaseName());
+ Tags.DB_STATEMENT.set(span, cacheObject.getSql());
+ span.setComponent(connectInfo.getComponent());
+ SpanLayer.asDB(span);
+ }
+
+ @Override
+ public final Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
+ Class>[] argumentsTypes,
+ Object ret) throws Throwable {
+ StatementEnhanceInfos cacheObject = (StatementEnhanceInfos)objInst.getSkyWalkingDynamicField();
+ if (cacheObject.getConnectionInfo() != null) {
+ ContextManager.stopSpan();
+ }
+ return ret;
+ }
+
+ @Override public final void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
+ Class>[] argumentsTypes, Throwable t) {
+ StatementEnhanceInfos cacheObject = (StatementEnhanceInfos)objInst.getSkyWalkingDynamicField();
+ if (cacheObject.getConnectionInfo() != null) {
+ ContextManager.activeSpan().errorOccurred().log(t);
+ }
+ }
+
+ private String buildOperationName(ConnectionInfo connectionInfo, String methodName, String statementName) {
+ return connectionInfo.getDBType() + "/JDBI/" + statementName + "/" + methodName;
+ }
+}
diff --git a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/StatementExecuteMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/StatementExecuteMethodsInterceptor.java
new file mode 100644
index 000000000..df6668e39
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/StatementExecuteMethodsInterceptor.java
@@ -0,0 +1,76 @@
+/*
+ * 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.jdbc.oracle;
+
+import java.lang.reflect.Method;
+import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.context.tag.Tags;
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
+import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
+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.plugin.jdbc.define.StatementEnhanceInfos;
+import org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
+
+public class StatementExecuteMethodsInterceptor implements InstanceMethodsAroundInterceptor {
+ @Override
+ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes,
+ MethodInterceptResult result) throws Throwable {
+ StatementEnhanceInfos cacheObject = (StatementEnhanceInfos)objInst.getSkyWalkingDynamicField();
+ ConnectionInfo connectInfo = cacheObject.getConnectionInfo();
+
+ AbstractSpan span = ContextManager.createExitSpan(buildOperationName(connectInfo, method.getName(), cacheObject.getStatementName()), connectInfo.getDatabasePeer());
+ Tags.DB_TYPE.set(span, "sql");
+ Tags.DB_INSTANCE.set(span, connectInfo.getDatabaseName());
+
+ String sql = "";
+ if (allArguments.length > 0) {
+ sql = (String)allArguments[0];
+ }
+
+ Tags.DB_STATEMENT.set(span, sql);
+ span.setComponent(connectInfo.getComponent());
+
+ SpanLayer.asDB(span);
+ }
+
+ @Override
+ public final Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
+ Class>[] argumentsTypes,
+ Object ret) throws Throwable {
+ StatementEnhanceInfos cacheObject = (StatementEnhanceInfos)objInst.getSkyWalkingDynamicField();
+ if (cacheObject.getConnectionInfo() != null) {
+ ContextManager.stopSpan();
+ }
+ return ret;
+ }
+
+ @Override public final void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
+ Class>[] argumentsTypes, Throwable t) {
+ StatementEnhanceInfos cacheObject = (StatementEnhanceInfos)objInst.getSkyWalkingDynamicField();
+ if (cacheObject.getConnectionInfo() != null) {
+ ContextManager.activeSpan().errorOccurred().log(t);
+ }
+ }
+
+ private String buildOperationName(ConnectionInfo connectionInfo, String methodName, String statementName) {
+ return connectionInfo.getDBType() + "/JDBI/" + statementName + "/" + methodName;
+ }
+}
diff --git a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/ConnectionInstrumentation.java b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/ConnectionInstrumentation.java
index 7533ae68d..f4542100f 100644
--- a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/ConnectionInstrumentation.java
+++ b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/ConnectionInstrumentation.java
@@ -16,12 +16,10 @@
*
*/
-
package org.apache.skywalking.apm.plugin.jdbc.oracle.define;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
-import org.apache.skywalking.apm.agent.core.plugin.bytebuddy.ArgumentTypeNameMatch;
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.enhance.ClassInstanceMethodsEnhancePluginDefine;
@@ -33,28 +31,23 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
/**
- * {@link ConnectionInstrumentation} intercept the following methods that the class which extend {@link
- * oracle.jdbc.driver.PhysicalConnection}.
- *
- * 1. Enhance prepareStatement by org.apache.skywalking.apm.plugin.jdbc.define.JDBCPrepareStatementInterceptor
- * 2. Enhance prepareStatement that the seconds argument type is java.lang.String[] by
- * oracle.jdbc.driver.JDBCPrepareStatementWithArrayInterceptor
- * 3. Enhance prepareStatement that the seconds argument type is int[] by
- * oracle.jdbc.driver.JDBCPrepareStatementWithArrayInterceptor
- * 4. Enhance prepareCall by
- * org.apache.skywalking.apm.plugin.jdbc.define.JDBCPrepareCallInterceptor
- * 5. Enhance createStatement
- * by org.apache.skywalking.apm.plugin.jdbc.define.JDBCStatementInterceptor
- * 6. Enhance commit, rollback, close, releaseSavepoint by org.apache.skywalking.apm.plugin.jdbc.define.ConnectionServiceMethodInterceptor
+ * {@link ConnectionInstrumentation} define that the oracle plugin intercept the following methods that the class which
+ * extend {@link oracle.jdbc.driver.PhysicalConnection}.
+ *
+ * 1. Enhance* * @author zhangxin */ public class ConnectionInstrumentation extends ClassInstanceMethodsEnhancePluginDefine { - private static final String PREPARE_STATEMENT_METHOD_WITH_ARRAY_INTERCEPTOR_CLASS = "oracle.jdbc.driver.JDBCPrepareStatementWithArrayInterceptor"; public static final String ENHANCE_CLASS = "oracle.jdbc.driver.PhysicalConnection"; - public static final String STRING_ARRAY_ARGUMENT_TYPE = "java.lang.String[]"; - public static final String INT_ARRAY_ARGUMENT_TYPE = "int[]"; + public static final String PREPARED_STATEMENT_INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.jdbc.oracle.CreatePreparedStatementInterceptor"; + public static final String CALLABLE_INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.jdbc.oracle.CreateCallableInterceptor"; + public static final String CREATE_STATEMENT_INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.jdbc.oracle.CreateStatementInterceptor"; @Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { return new ConstructorInterceptPoint[0]; @@ -64,37 +57,11 @@ public class ConnectionInstrumentation extends ClassInstanceMethodsEnhancePlugin return new InstanceMethodsInterceptPoint[] { new InstanceMethodsInterceptPoint() { @Override public ElementMatcherprepareStatementbyorg.apache.skywalking.apm.plugin.jdbc.oracle.CreatePreparedStatementInterceptor+ * 2. EnhanceprepareCallbyorg.apache.skywalking.apm.plugin.jdbc.oracle.CreateCallableInterceptor+ * 3. EnhancecreateStatementbyorg.apache.skywalking.apm.plugin.jdbc.oracle.CreateStatementInterceptor+ * 4. Enhancecommit, rollback, close, releaseSavepointbyorg.apache.skywalking.apm.plugin.jdbc.define.ConnectionServiceMethodInterceptor+ *
execute, executeQuery and
+ * executeUpdate method in {@link oracle.jdbc.driver.OracleCallableStatement} class by ${@link
+ * org.apache.skywalking.apm.plugin.jdbc.oracle.StatementExecuteMethodsInterceptor}
+ *
+ * @author zhangxin
+ */
+public class OracleCallableInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+
+ public static final String ENHANCE_CLASS = "oracle.jdbc.driver.OracleCallableStatement";
+
+ @Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+ return new ConstructorInterceptPoint[0];
+ }
+
+ @Override protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
+ return new InstanceMethodsInterceptPoint[] {
+ new InstanceMethodsInterceptPoint() {
+ @Override public ElementMatcherexecute,
+ * executeQuery, executeUpdate and executeLargeUpdate method in {@link oracle.jdbc.driver.OraclePreparedStatement}
+ * class by ${@link org.apache.skywalking.apm.plugin.jdbc.oracle.StatementExecuteMethodsInterceptor}
+ *
+ * @author zhangxin
+ */
+public class OraclePrepareStatementInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+
+ public static final String ENHANCE_CLASS = "oracle.jdbc.driver.OraclePreparedStatement";
+
+ @Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+ return new ConstructorInterceptPoint[0];
+ }
+
+ @Override protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
+ return new InstanceMethodsInterceptPoint[] {
+ new InstanceMethodsInterceptPoint() {
+ @Override public ElementMatcherexecute, executeQuery,
+ * executeUpdate and executeLargeUpdate method in {@link oracle.jdbc.driver.OracleStatement} class by ${@link
+ * org.apache.skywalking.apm.plugin.jdbc.oracle.StatementExecuteMethodsInterceptor}
+ *
+ * @author zhangxin
+ */
+public class OracleStatementInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+
+ public static final String ENHANCE_CLASS = "oracle.jdbc.driver.OracleStatement";
+
+ @Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+ return new ConstructorInterceptPoint[0];
+ }
+
+ @Override protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
+ return new InstanceMethodsInterceptPoint[] {
+ new InstanceMethodsInterceptPoint() {
+ @Override public ElementMatcher