To start with, the jar that I need to connect to MySQL 5.5 should have been mysql-connector-java-5.1.15-bin.jar but
not mysql-connector-java-5.1.15.jar.
Secondly, this jar is not available in maven repository so I needed to manually add it to my local maven repository and then added it as a dependency in my pom.xml.
Adding mysql-connector-java-5.1.15.jar to
the local maven repository by mvn
install:install-file -Dfile=C:\Libraries\mysql-connector-java-5.1.15-bin\mysql-connector-java-5.1.15-bin.jar -DgroupId=mysql -DartifactId=mysql-connector-java -Dversion=5.1.15-bin -Dpackaging=jar and then adding the following dependency to pom.xml of
the project.
<!-- MySql 5.5 Connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.15-bin</version>
</dependency>
本文介绍如何正确配置MySQL5.5连接器以确保应用程序能够成功连接到MySQL5.5数据库。具体步骤包括选择正确的JAR文件版本、手动安装到本地Maven仓库并添加依赖。
563

被折叠的 条评论
为什么被折叠?



