当前位置:网站首页>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,
边栏推荐
- 虚拟机查看端口号进程
- Phospholipids-Polyethylene Glycol-Active Esters for Scientific Research DSPE-PEG-NHS CAS: 1445723-73-8
- VS2017连接MYSQL
- 浅谈对分布式模式下CAP的理解
- Cholesterol-PEG-Acid CLS-PEG-COOH 胆固醇-聚乙二醇-羧基修饰肽类化合物
- Shell/Vim related list
- Web Screenshots and Reverse Proxy
- Pytorch每日一练——预测泰坦尼克号船上的生存乘客
- mPEG-DSPE 178744-28-0 甲氧基-聚乙二醇-磷脂酰乙醇胺线性PEG磷脂
- wangeditor富文本编辑器上传图片以及跨域问题解决
猜你喜欢
qt:cannot open C:\Users\某某某\AppData\Local\Temp\main.obj.15576.16.jom for write
Cholesterol-PEG-Amine CLS-PEG-NH2 Cholesterol-Polyethylene Glycol-Amino Research Use
Flutter mixed development module dependencies
Pytorch每日一练——预测泰坦尼克号船上的生存乘客
opencv之图像二值化处理
MySQL 入门:Case 语句很好用
Cholesterol-PEG-Azide CLS-PEG-N3 Cholesterol-PEG-Azide MW:3400
Gradle sync failed: Uninitialized object exists on backward branch 142
2022 SQL big factory high-frequency practical interview questions (detailed analysis)
Tensorflow边用边踩坑
随机推荐
qt:cannot open C:\Users\XX\AppData\Local\Temp\main.obj.15576.16.jom for write
understand js operators
2021-09-30
多元线性回归方程原理及其推导
禅道安装及使用教程
深度学习知识点杂谈
DSPE-PEG-Azide DSPE-PED-N3 磷脂-聚乙二醇-叠氮脂质PFG
评估机器学习模型-摘抄
DC-CDN学习笔记
科学研究用磷脂-聚乙二醇-活性酯 DSPE-PEG-NHS CAS:1445723-73-8
VS通过ODBC连接MYSQL(二)
朴素贝叶斯文本分类(代码实现)
Word vector - demo
数据预处理、特征工程和特征学习-摘抄
DSPE-PEG-COOH CAS:1403744-37-5 磷脂-聚乙二醇-羧基脂质PEG共轭物
Introduction to CLS-PEG-FITC Fluorescein-PEG-CLS Cholesterol-PEG-Fluorescein
cocos2d-x implements cross-platform directory traversal
CLS-PEG-FITC Fluorescein-PEG-CLS 胆固醇-聚乙二醇-荧光素简介
pytorch模型微调finetuning训练image_dog(kaggle)
Session和Cookie,Token