当前位置:网站首页>Learn how to get a database connection with JDBC
Learn how to get a database connection with JDBC
2022-07-31 06:23:00 【slx9920】
1. Preparations
1.1 Import JDBC jar package
First, we need a jar package for the JDBC driver, which you can download from the official website.
- Oracle's driver: oracle.jdbc.driver.OracleDriver
- MySQL driver: com.mysql.jdbc.Driver
Next, import the JDBC jar package into the IDEA class library: press Ctrl+Shift+Alt+s to open Project Structure, click "+",Select Java, find the storage location of your JDBC, and click OK.

The following means the import was successful
1.2 create a database in MySQL

Ideas
You can use Maven to manage the project download and import JDBC jar package. I have not tried this method. Interested friends can try it. I also want to know!
2. Create a configuration file
As follows, first create a file, here I created it under the corresponding package, of course, you can also create it under the src of the project, and write the basic information of the database connection

3. Write code

It works perfectly, very nice, perfect,
边栏推荐
- Cholesterol-PEG-NHS NHS-PEG-CLS 胆固醇-聚乙二醇-活性酯可修饰小分子材料
- 评估机器学习模型-摘抄
- 日志jar包冲突,及其解决方法
- VS connects to MYSQL through ODBC (1)
- IDEA控制台不能输入信息的解决方法
- Podspec verification dependency error problem pod lib lint , need to specify the source
- VS通过ODBC连接MYSQL(二)
- 科学研究用磷脂-聚乙二醇-活性酯 DSPE-PEG-NHS CAS:1445723-73-8
- Tensorflow related list
- Tencent Cloud GPU Desktop Server Driver Installation
猜你喜欢

使用 OpenCV 提取图像的 HOG、SURF 及 LBP 特征 (含代码)

Gradle sync failed: Uninitialized object exists on backward branch 142

MySQL 免安装版的下载与配置教程

softmax函数详解

Pytorch学习笔记7——处理多维特征的输入

禅道安装及使用教程

Cholesterol-PEG-Acid CLS-PEG-COOH Cholesterol-Polyethylene Glycol-Carboxyl Modified Peptides

多元线性回归方程原理及其推导

VS通过ODBC连接MYSQL(一)

After unicloud is released, the applet prompts that the connection to the local debugging service failed. Please check whether the client and the host are under the same local area network.
随机推荐
词向量——demo
IDEA控制台不能输入信息的解决方法
Understanding of objects and functions in js
Word vector - demo
TransactionTemplate 事务编程式写法
Web Screenshots and Reverse Proxy
禅道安装及使用教程
Cholesterol-PEG-Acid CLS-PEG-COOH 胆固醇-聚乙二醇-羧基修饰肽类化合物
VS2017连接MYSQL
【解决问题】RuntimeError: The size of tensor a (80) must match the size of tensor b (56) at non-singleton
Pytorch每日一练——预测泰坦尼克号船上的生存乘客
unicloud 发布后小程序提示连接本地调试服务失败,请检查客户端是否和主机在同一局域网下
CAS: 1403744-37-5 DSPE-PEG-FA Phospholipid-Polyethylene Glycol-Folic Acid for Scientific Research
我的训练函数模板(动态修改学习率、参数初始化、优化器选择)
Hyperparameter Optimization - Excerpt
自然语言处理相关list
np.fliplr与np.flipud
变分自编码器VAE实现MNIST数据集生成by Pytorch
VTK环境配置
VS2017 connects to MYSQL