opentracing-contrib / java-jdbc

OpenTracing Instrumentation for JDBC
Apache License 2.0
82 stars 56 forks source link

Unable to find a driver that accepts #9

Closed zjutsuper closed 5 years ago

zjutsuper commented 6 years ago

dataSource is DruidDataSource

String realUrl = this.extractRealUrl(url); String dbType = this.extractDbType(realUrl); String dbUser = info.getProperty("user"); Driver wrappedDriver = this.findDriver(realUrl);

this.findDriver(url) need using url not realUrl this version will throw Excetpion Caused by: java.sql.SQLException: Unable to find a driver that accepts jdbc:mysql://172.16.71.2:3306/tradecenter?useUnicode=true&characterEncoding=utf-8

ssullivan commented 6 years ago

I had a similar issue and was able to resolve it by registering the database driver before configuring the datasource. I’ve only seen this problem when deploying a WAR in Tomcat so far . It doesn’t seem to occur when deploying with an embedded Jetty.

Class.forName("com.mysql.jdbc.Driver");

malafeev commented 6 years ago

I will add it at least to README

malafeev commented 5 years ago

README updated