简体   繁体   English

我想在Java应用程序和Xampp之间建立连接

[英]I want to connect between Java app and Xampp

Enter code here: 在这里输入代码:

这是我的应用程序和错误:

private static final String CONNECTION_PATH = "jdbc:mysql://localhost:3306/parking"; 

The problem lies in the connection path and the URL of parking database. 问题出在停车数据库的连接路径URL

The problem is that you don't have the mysql JDBC driver available at runtime. 问题是您在运行时没有可用的mysql JDBC驱动程序。

You need to get the JDBC driver on your classpath. 您需要在类路径上获取JDBC驱动程序。

This may help ( no idea how current it is but it explains how to install the driver. ) 可能会有所帮助(不知道它有多新,但是它说明了如何安装驱动程序。)

If you are using maven, put 如果您正在使用Maven,请放

<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
  <groupId>mysql</groupId>
  <artifactId>mysql-connector-java</artifactId>
  <version>6.0.6</version>
</dependency>

into your pom and you should be ready to go. 进入您的pom,您应该准备好了。

If you are not using maven, grab the jar file from http://central.maven.org/maven2/mysql/mysql-connector-java/6.0.6/mysql-connector-java-6.0.6.jar and add it to your classpath. 如果您不使用Maven,请从http://central.maven.org/maven2/mysql/mysql-connector-java/6.0.6/mysql-connector-java-6.0.6.jar抓取jar文件并将其添加到你的classpath。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我无法让Android应用连接到XAMPP Localhost - I can't get Android app to connect to XAMPP Localhost 我想连接到Java上的数据库,但是有一些错误 - i want to connect to db on java, but there is some errors 我正在尝试制作社交媒体应用。 如何将我的应用程序连接到mySql和Xampp? - I am trying to make a social media app. How do I connect my app to a mySql and, Xampp? 我想为在Netbeans中开发的Java项目创建安装程序,并使用Mysql Xampp - I want to create setup for my Java project developed in Netbeans and have Mysql Xampp 如何将 java web 中的 JDBC 连接到 ZF8756D88C7D3B98E2E3E3F(本地主机)? - How can i connect my JDBC in java web to XAMPP (localhost) (NETBEANS)? Java Connect4 游戏。 我想检查列是否已满 - Java Connect4 game . I want to check if the column is full 我想将一个 Angular 6 前端连接到一个 java servlet - I want to connect an angular 6 front end to a java servlet 我想将 Netbeans java 应用程序与 Firebase 数据库连接 - I want to connect a Netbeans java application with Firebase Database 我想计算Java中两点之间的距离 - I want to calculate the distance between two points in Java 无法使用XAMPP将使用JDBC的Android App连接到MYSQL数据库 - Unable to connect android App using JDBC to MYSQL database using XAMPP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM