/*
 * Copyright 2016-2018 shardingsphere.io.
 * <p>
 * Licensed 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.
 * </p>
 */

package io.shardingsphere.core.property;

import javax.sql.DataSource;

/**
 * Data source parameter parser.
 *
 * @author panjuan
 */
public interface DataSourcePropertyParser {
    
    /**
     * Parse data source.
     *
     * @param dataSource data source.
     * @return data source property.
     */
    DataSourceProperty parseDataSource(DataSource dataSource);
}

@@ -666,28 +666,146 @@
 ort 
-javax.sql.DataSource
+io.shardingsphere.core.exception.ShardingException;%0A%0Aimport javax.sql.DataSource;%0Aimport java.sql.Connection;%0Aimport java.sql.SQLException
 ;%0A%0A/
@@ -877,17 +877,22 @@
 lic 
-interface
+abstract class
  Dat
@@ -993,25 +993,24 @@
  data source
-.
 %0A     * @ret
@@ -1033,17 +1033,16 @@
 property
-.
 %0A     */
@@ -1046,16 +1046,23 @@
  */%0A    
+public 
 DataSour
@@ -1088,16 +1088,22 @@
 aSource(
+final 
 DataSour
@@ -1116,12 +1116,318 @@
 aSource)
+ %7B%0A        try (Connection connection = dataSource.getConnection()) %7B%0A            return parseJDBCUrl(connection.getMetaData().getURL());%0A        %7D catch (SQLException ex) %7B%0A            throw new ShardingException(ex);%0A        %7D%0A    %7D%0A    %0A    protected abstract DataSourceProperty parseJDBCUrl(String url)
 ;%0A%7D%0A

modify to abstract class.