yangzhg commented on code in PR #18799:
URL: https://github.com/apache/doris/pull/18799#discussion_r1170720791


##########
fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java:
##########
@@ -244,49 +260,58 @@ public static Object convertClickHouseArray(Object obj) {
     private void init(String driverUrl, String sql, int batchSize, String 
driverClass, String jdbcUrl, String jdbcUser,
             String jdbcPassword, TJdbcOperation op, TOdbcTableType tableType) 
throws UdfRuntimeException {
         try {
-            ClassLoader parent = getClass().getClassLoader();
-            ClassLoader classLoader = UdfUtils.getClassLoader(driverUrl, 
parent);
-            druidDataSource = JdbcDataSource.getDataSource().getSource(jdbcUrl 
+ jdbcUser + jdbcPassword);
-            if (druidDataSource == null) {
-                DruidDataSource ds = new DruidDataSource();
-                ds.setDriverClassLoader(classLoader);
-                ds.setDriverClassName(driverClass);
-                ds.setUrl(jdbcUrl);
-                ds.setUsername(jdbcUser);
-                ds.setPassword(jdbcPassword);
-                ds.setMinIdle(minIdleSize);
-                ds.setInitialSize(minPoolSize);
-                ds.setMaxActive(maxPoolSize);
-                ds.setMaxWait(5000);
-                ds.setTimeBetweenEvictionRunsMillis(maxIdelTime);
-                ds.setMinEvictableIdleTimeMillis(maxIdelTime / 2);
-                druidDataSource = ds;
-                // here is a cache of datasource, which using the 
string(jdbcUrl + jdbcUser +
-                // jdbcPassword) as key.
-                // and the default datasource init = 1, min = 1, max = 100, if 
one of connection idle
-                // time greater than 10 minutes. then connection will be 
retrieved.
-                JdbcDataSource.getDataSource().putSource(jdbcUrl + jdbcUser + 
jdbcPassword, ds);
-            }
-            conn = druidDataSource.getConnection();
-            if (op == TJdbcOperation.READ) {
-                conn.setAutoCommit(false);
-                Preconditions.checkArgument(sql != null);
-                stmt = conn.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, 
ResultSet.CONCUR_READ_ONLY);
-                if (tableType == TOdbcTableType.MYSQL) {
-                    stmt.setFetchSize(Integer.MIN_VALUE);
-                } else {
-                    stmt.setFetchSize(batchSize);
-                }
+            if (isGraph()) {

Review Comment:
   why nebula cannot use DruidDataSource



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to