java - 连接到netbeans的数据库
问题描述
我已经使用 EasyPHP 创建了一个数据库,但后来我发现我可以直接在 NetBeans 8.2 上创建我的数据库。我创建的数据库有点太大:重新创建它需要一些时间。我没有设法将它导入到 NetBeans 的数据库中,而且我很难连接到 NetBeans 上的任何数据库。我想知道如何将它导入 NetBeans 的数据库,它是否与我在 EasyPHP 中使用的代码(下面的代码)相同,或者我应该更改什么?
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
new NotificationBuilder().withStyle(new DarkDefaultNotification()).withTitle("erreur")
.withMessage("Erreur au niveau du driver").withDisplayTime(3000).showNotification();
}
try {
con= DriverManager.getConnection(url,name,pwd);
} catch (SQLException e) {
new NotificationBuilder().withStyle(new DarkDefaultNotification()).withTitle("erreur 2")
.withMessage("erreur d'etablissement de connexion").withDisplayTime(3000).showNotification();
}
解决方案
推荐阅读
- python - 更新更改字符串:如何为 python 编写正则表达式,以便提取一个术语及其定义?
- c# - 在 Visual Studio 中添加对单个 c# 脚本的 XML 引用
- ruby-on-rails - 包含 boostrap 时预编译资产失败
- python - 如何安装或制作工作 keras_retinanet.utils.gpu 模块?
- javascript - Gatsby 1 类组件
- c++ - 如何在结构初始化列表中实例化类
- javascript - 为什么这个reduce函数只在指定最后一个参数时才起作用?
- java - Java中Twilio中创建者方法的语法错误
- c# - C# 数组成员
- java - Hibernate 两次将数据插入到联接表中,导致 Spring Boot 项目中的“ORA-00001:违反唯一约束”