当前位置:网站首页>JDBC introduction
JDBC introduction
2022-07-06 15:11:00 【Hand pluckable Xinchen】
1,JDBC Concept
Java Database Connectivity(JDBC):Java Access to the database solution .
JDBC Defines a set of interfaces , That is to access the general database API, Different database manufacturers implement these interfaces according to the characteristics of their respective databases .
JDBC You want to access different databases in the same way , Let the specific database operation have nothing to do with the implementation of the database manufacturer , Thus in
Easily switch between different databases .
2,JDBC Related class interface
Class.forName("com.mysql.cj.jdbc.Driver");String url = "jdbc:mysql://localhost:3306/dayone?serverTimezone=GMT";
String user = "root";
String pwd = "123456";
Connection conn = DriverManager.getConnection(url, user, pwd);String sql = "insert into student(sname,birthday,ssex,classid) values(' Zhang San ','2022-1-1',' male ','100')";
Statement statm = conn.createStatement();int ret = statm.executeUpdate(sql); // perform DML sentence ( add to , Delete , modify ), Return value int
//ResultSet rs = stmt.executeQuery(sql); // perform DQL sentence ( Inquire about ), Return value ResultSet
if(ret > 0) {
System.out.println(" Execution succeeded ");
}else {
System.out.println(" Execution failed ");
}(5) Release resources
statm.close();
conn.close();边栏推荐
- Don't you even look at such a detailed and comprehensive written software test question?
- In Oracle, start with connect by prior recursive query is used to query multi-level subordinate employees.
- If the position is absolute, touchablehighlight cannot be clicked - touchablehighlight not clickable if position absolute
- Face and eye recognition based on OpenCV's own model
- UCORE lab1 system software startup process experimental report
- 软件测试行业的未来趋势及规划
- Vysor uses WiFi wireless connection for screen projection_ Operate the mobile phone on the computer_ Wireless debugging -- uniapp native development 008
- A method and implementation of using VSTO to prohibit excel cell editing
- Capitalize the title of leetcode simple question
- [pointer] find the length of the string
猜你喜欢
软件测试需求分析之什么是“试纸测试”

Fundamentals of digital circuits (II) logic algebra

What is the transaction of MySQL? What is dirty reading and what is unreal reading? Not repeatable?

Summary of thread implementation

Fundamentals of digital circuits (I) number system and code system

Statistics 8th Edition Jia Junping Chapter 2 after class exercises and answer summary

Leetcode simple question: check whether two strings are almost equal

UCORE lab8 file system experiment report

Install and run tensorflow object detection API video object recognition system of Google open source
软件测试方法有哪些?带你看点不一样的东西
随机推荐
Four methods of exchanging the values of a and B
Thinking about three cups of tea
软件测试需求分析之什么是“试纸测试”
想跳槽?面试软件测试需要掌握的7个技能你知道吗
[issue 18] share a Netease go experience
STC-B学习板蜂鸣器播放音乐
MySQL数据库(五)视 图 、 存 储 过 程 和 触 发 器
转行软件测试必需要知道的知识
Global and Chinese markets of PIM analyzers 2022-2028: Research Report on technology, participants, trends, market size and share
安全测试入门介绍
几款开源自动化测试框架优缺点对比你知道吗?
CSAPP Shell Lab 实验报告
What level do 18K test engineers want? Take a look at the interview experience of a 26 year old test engineer
Example 071 simulates a vending machine, designs a program of the vending machine, runs the program, prompts the user, enters the options to be selected, and prompts the selected content after the use
Using flask_ Whooshalchemyplus Jieba realizes global search of flask
My first blog
Mysql的事务
Common Oracle commands
Public key box
Global and Chinese market of maleic acid modified rosin esters 2022-2028: Research Report on technology, participants, trends, market size and share