当前位置:网站首页>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下创建一个类
⑥ 类中:
数据库之前:
运行结果:
运行之后数据库:
边栏推荐
- Keep your Eyes on the Lane: Real-time Attention-guided Lane Detection
- Wechat sports ground reservation applet graduation design of applet completion works (3) background function
- Graduation design of wechat small program ordering system of small program completion works (5) assignment
- Network solutions for Alibaba cloud services
- efcore在Saas系统下多租户零脚本分表分库读写分离解决方案
- C语言实现二叉平衡树
- Bigdecimel in words
- QA robot sequencing model
- Talk about your transformation test development process
- 这家十年内容产业基建公司,竟是隐形的Web3先行者
猜你喜欢

这是我见过写得最烂的Controller层代码...

QA robot sequencing model

Arcgis10.2 installation tutorial

音乐人的 NFT 指南

图解LeetCode——919. 完全二叉树插入器(难度:中等)

@Use of data annotation (instead of get and set methods in entity classes)

Initial knowledge of WebService (generate jar packages and call methods in remote services)

Wechat sports field reservation of the finished works of the applet graduation project (4) opening report

Django4.0 + web + MySQL 5.7 realize simple login operation

NVIDIA programmable reasoning accelerator tensorrt learning notes (II) - practical operation
随机推荐
技术面②Mysql中的索引(index)类型有哪些并简要介绍一下?什么时候需要创建索引?什么时候不需要创建索引?为什么创建索引后查询速度会提高?
51 single chip microcomputer controls nixie tube display
防抖与节流
Additional: in the lower division / county (data sheet)
Hash table questions (Part 1)
Practice of establishing dynamic programming state transition equation
Additional: SQL statement area / county in the lower half (data table)
25位撤销博士学位
(self drawn ugly picture) simple understanding tcp/ip three handshakes and four waves
Wechat sports ground reservation applet graduation project of applet completion works (1) development outline
This is the worst controller layer code I've ever seen
51 MCU internal peripherals: serial port communication
【无标题】
Wechat reservation of small program completion works (5) assignment book of small program graduation project
Graduation design of wechat small program ordering system of small program completion works (3) background function
音乐人的 NFT 指南
The international summit osdi included Taobao system papers for the first time, and end cloud collaborative intelligence was recommended by the keynote speech of the conference
Wechat reservation applet graduation design of applet completion works (2) applet function
Wechat applet ordering system graduation design of applet completion works (8) graduation design thesis template
Read and write models and organize notes









