有没有一种方法可以确定部署真正使用的是哪个jdbc驱动程序?

时间:2018-07-26 20:12:04

标签: java-ee jdbc wildfly wildfly-10 jboss-cli

给出:

  • 有效的Wildfly 10.1安装
  • 至少已安装两个jdbc sql server jar文件版本
  • 至少有4个已部署的war应用程序,其中关联的pom.xml文件未指定jdbc版本
  • 有效的jboss-cli连接
  • 有效的jconsole连接到应用程序服务器

是否可以确定用于部署的JDBC驱动程序版本? pom.xml没有指定版本。

我尝试过的方法: 我可以列出已安装的驱动程序:

[standalone@localhost:9990 /] /subsystem=datasources:installed-drivers-list
{
"outcome" => "success",
"result" => [
    {
        "driver-name" => "acme-xyz-processor-3.4.25-develop-1380.war_com.microsoft.sqlserver.jdbc.SQLServerDriver_4_0",
        "deployment-name" => "acme-xyz-processor-3.4.25-develop-1380.war_com.microsoft.sqlserver.jdbc.SQLServerDriver_4_0",
        "driver-module-name" => undefined,
        "module-slot" => undefined,
        "driver-datasource-class-name" => undefined,
        "driver-xa-datasource-class-name" => undefined,
        "driver-class-name" => "com.microsoft.sqlserver.jdbc.SQLServerDriver",
        "driver-major-version" => 4,
        "driver-minor-version" => 0,
        "jdbc-compliant" => true
    },
    {
        "driver-name" => "sqlserver",
        "deployment-name" => undefined,
        "driver-module-name" => "com.microsoft.sqlserver",
        "module-slot" => "main",
        "driver-datasource-class-name" => "",
        "driver-xa-datasource-class-name" => "",
        "driver-class-name" => "com.microsoft.sqlserver.jdbc.SQLServerDriver",
        "driver-major-version" => 6,
        "driver-minor-version" => 4,
        "jdbc-compliant" => true
    },
    {
        "driver-name" => "acme-xyz-processor-3.4.25-develop-1380.war_org.postgresql.Driver_9_4",
        "deployment-name" => "acme-xyz-processor-3.4.25-develop-1380.war_org.postgresql.Driver_9_4",
        "driver-module-name" => undefined,
        "module-slot" => undefined,
        "driver-datasource-class-name" => undefined,
        "driver-xa-datasource-class-name" => undefined,
        "driver-class-name" => "org.postgresql.Driver",
        "driver-major-version" => 9,
        "driver-minor-version" => 4,
        "jdbc-compliant" => false
    },
    {
        "driver-name" => "h2",
        "deployment-name" => undefined,
        "driver-module-name" => "com.h2database.h2",
        "module-slot" => "main",
        "driver-datasource-class-name" => "",
        "driver-xa-datasource-class-name" => "org.h2.jdbcx.JdbcDataSource",
        "driver-class-name" => "org.h2.Driver",
        "driver-major-version" => 1,
        "driver-minor-version" => 3,
        "jdbc-compliant" => true
    }
]
}
[standalone@localhost:9990 /]

但这只是驱动程序列表。我真正关心的是,其中一个应用程序显然已经指定了SQL Server JDBC的4.0版本。我没看错吗?

在这一点上,我决定尝试确定部署的应用程序所使用的版本。

是否可以确定未指定给定部署实际使用的驱动程序?您可能会认为这是最新的,但是我需要确定。

0 个答案:

没有答案