当前位置:网站首页>JDBC快速入门
JDBC快速入门
2022-07-25 08:51:00 【华为云】
目录
JDBC简介
JDBC概念
①JDBC就是使用Java语言操作关系型数据录的一套API
②全称是(Java DataBase Connectivity),叫Java数据库连接。
JDBC本质
①官方(sun公司)定义的一套操作所有关系型数据库的规则,即为接口。
②各个数据库厂商去实现这套接口,提供数据库驱动jar包。
③我们可以使用这套接口(JDBC)编程,真正执行的代码是驱动jar包中的实现类
JDBC好处
①各数据库厂商使用相同的接口,Java代码不需要针对不同数据库分别开发不同的代码
②可随时替换底层数据库,访问数据库的Java代码基本不变
关系图示:
MySQLjar包下载地址
一般选择独立于平台的这个选项
①创建新的项目
②之后再建立一个模块
③在新建的的jdbc-demo模块中创建一个lib目录,将mysql的jar包复制粘贴到此处
④将刚才导入的jar包设置作用范围(右键jar包)
⑤在src下创建一个类
⑥ 类中:
数据库之前:
运行结果:
运行之后数据库:
边栏推荐
- 提高代码可续性的小技巧,以connectTo方法为例。
- [ten thousand words long text] Based on LSM tree thought Net 6.0 C # realize kV database (case version)
- 附加:在在下部分区/县(数据表)
- 附加:中半部分sql语句 区/县(数据表)
- @Differences between requestparam, @pathparam, @pathvariable and other annotations (use of some annotations)
- unity客户端读取文本配置
- Dependency conflict resolution under idea
- Wechat reservation of small program completion works (5) assignment book of small program graduation project
- Basis 33: XPath acquisition methods of page elements under various browsers
- LeetCode·83双周赛·6129.全0子数组的数目·数学
猜你喜欢

Django4.0 + Web + MySQL5.7 实现简单登录操作

为什么说DAO是未来的公司形式

Intel apologized to the winners of Xe HPG treasure hunt game for product delay and announced the appearance of the prize
![[Development Tutorial 9] crazy shell · open source Bluetooth smart health watch - storage](/img/25/212712d919540763a6c339e1b5a50b.png)
[Development Tutorial 9] crazy shell · open source Bluetooth smart health watch - storage

Foundation 32: page element positioning method XPath --- axis positioning method
![[ten thousand words long text] Based on LSM tree thought Net 6.0 C # realize kV database (case version)](/img/07/235785b7658b5ae022dfa3f53ec86d.png)
[ten thousand words long text] Based on LSM tree thought Net 6.0 C # realize kV database (case version)

Implementation of depth first and breadth first traversal of binary tree

Redis/Mysql知识概述

25 Ph.D. degrees revoked

Swift initializer and optional chain
随机推荐
这家十年内容产业基建公司,竟是隐形的Web3先行者
Deduct one question every day - 2114. The maximum number of words in the sentence
Yolov5 environment configuration
51单片机内部外设:串口通信
音乐人的 NFT 指南
【sklearn】sklearn.preprocessing.LabelEncoder
酷炫canvas动画冲击波js特效
How does Flink SQL persist?
CIR industrial automation radar
Django4.0 + web + MySQL 5.7 realize simple login operation
QA robot sequencing model
Additional: in the lower division / county (data sheet)
PHP reports an error: classes\phpexcel\cell php Line(594) Invalid cell coordinate ESIGN1
Graduation design of wechat small program ordering system of small program completion works (3) background function
Wechat reservation applet graduation design of applet completion works (2) applet function
Wechat applet ordering system graduation design of applet completion works (2) applet function
Wechat applet ordering system graduation design of applet completion works (8) graduation design thesis template
51 single chip microcomputer controls nixie tube display
Qt|qlabole change line spacing when displaying multiple lines
IDEA下依赖冲突解决方法









