1

我正在尝试在 Spring Roo 中安装 MySQL JDBC 驱动程序。这是日志:

roo> addon search --requiresDescription "#jdbcdriver,driverclass:com.mysql.jdbc.Driver"
0 found, sorted by rank; T = trusted developer; R = Roo 1.2 compatible
ID T R DESCRIPTION -------------------------------------------------------------
--------------------------------------------------------------------------------
[HINT] use 'addon info id --searchResultId ..' to see details about a search result
[HINT] use 'addon install id --searchResultId ..' to install a specific search result, or
[HINT] use 'addon install bundle --bundleSymbolicName TAB' to install a specific add-on version

我该做什么?

4

3 回答 3

6

在 Spring Roo 1.2.5.RELEASE 中,似乎有一个错误。add on 命令显示 MySQL 驱动程序已成功安装,但运行 DBRE 命令失败且未找到驱动程序。

对于这个版本的 Roo,我也有其他人抱怨这个问题。

对我有用的唯一方法是将 MySQL 驱动程序 (JAR) 手动复制到 /spring-roo-1.2.5.RELEASE/bundle 文件夹并重新启动 Spring STS,这是我运行 Roo 的位置。

那行得通;希望这可以帮助同一条船上的人。

于 2014-05-03T21:30:30.697 回答
2

告诉 roo 安装 jdbc-drive 试试这个:

roo> addon search jdbc
9 found, sorted by rank; T = trusted developer; R = Roo 1.2 compatible
ID T R DESCRIPTION -------------------------------------------------------------
01 Y Y 1.2.4.0010 #jdbcdriver driverclass:net.sourceforge.jtds.jdbc.Driver.
       This bundle wraps the standard Maven artifact: jtds-1.2.4.
02 Y Y 5.1.18.0001 #jdbcdriver driverclass:com.mysql.jdbc.Driver. This bundle
       wraps the standard Maven artifact: mysql-connector-java-5.1.18.
03 Y Y 10.8.2.2_0001 Derby Client #jdbcdriver
       driverclass:org.apache.derby.jdbc.ClientDriver. This bundle wraps the...
04 Y Y 6.7.0.0010 #jdbcdriver driverclass:com.ibm.as400.access.AS400JDBCDriver.
       This bundle wraps the standard Maven artifact: jtopen-6.7.
05 Y Y 10.8.2.2_0001 Derby #jdbcdriver
       driverclass:org.apache.derby.jdbc.EmbeddedDriver. This bundle wraps...
06 Y Y 9.1.0.901-1_0001 Postgres #jdbcdriver driverclass:org.postgresql.Driver.
       This bundle wraps the standard Maven artifact:...
07 Y Y 9.1.0.901_0001 Postgres #jdbcdriver driverclass:org.postgresql.Driver.
       This bundle wraps the standard Maven artifact:...
08 Y Y 1.3.170.0001 H2 #jdbcdriver driverclass:org.h2.Driver. This bundle wraps
       the standard Maven artifact: h2-1.3.170.
09 Y Y 2.1.6.0020 #jdbcdriver driverclass:org.firebirdsql.jdbc.FBDriver. This
       bundle wraps the standard Maven artifact: firebird-2.1.6.
--------------------------------------------------------------------------------
[HINT] use 'addon info id --searchResultId ..' to see details about a search result
[HINT] use 'addon install id --searchResultId ..' to install a specific search result, or
[HINT] use 'addon install bundle --bundleSymbolicName TAB' to install a specific add-on version
roo> addon install id --searchResultId 02

ID是列表中的ID...

于 2013-02-08T18:03:11.447 回答
1

如果您只是想添加驱动程序,您可以直接在 pom.xml 中添加它,例如

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.21</version>
</dependency>
于 2012-07-30T17:35:09.360 回答