public static function getJdbcDsn(string $driver, string $db, string $host, string $user, string $password, array $options = []): string
    {
        $extras = '';
        if (count($options) > 0) {
            $tmp = [];
            foreach ($options as $key => $value) {
                $tmp[] = urlencode($key).'='.urlencode($value);
            }
            $extras = '&'.implode('&', $tmp);
        }

        return "jdbc:$driver://$host/$db?user=$user&password=$password".$extras;
    }
public static function getJdbcDsn(string $driver, string $db, string $host, string $user, string $password, array $options = []): string
    {
        $extras = '';
        if (count($options) > 0) {
            $tmp = [];
            foreach ($options as $key => $value) {
                $tmp[] = urlencode($key).'='.urlencode($value);
            }
            $extras = '&'.implode('&', $tmp);
        }

        return "jdbc:$driver://$host/$db?user=$user&password=$password".$extras;
    }
public static function getJdbcDsn ( string $ driver , string $ db , string $ host , string $ user , string $ password , array $ options = [ ] ) : string { $ extras = '' ; if ( count ( $ options ) > 0 ) { $ tmp = [ ] ; foreach ( $ options as $ key => $ value ) { $ tmp [ ] = urlencode ( $ key ) . '=' . urlencode ( $ value ) ; } $ extras = '&' . implode ( '&' , $ tmp ) ; } return "jdbc:$driver://$host/$db?user=$user&password=$password" . $ extras ; }
Return a JDBC DSN formatted string from options.

@param string $driver   driver name  (mysql/mariadb/oracle/postgres...)
@param string $db       database name
@param string $host     server ip or name
@param string $user     username to connect
@param string $password password to connect
@param array  $options  extra options as an associative array

@return string
Return a JDBC DSN formatted string from options .