当前位置:网站首页>[JDBC] classic interview questions of JDBC, constantly updating
[JDBC] classic interview questions of JDBC, constantly updating
2022-07-24 08:16:00 【Sivan_ Xin】
What is? JDBC?
JDBC The full name is Java DataBase Connection.
That is to say Java Get database connection , By using JDBC Related interfaces and classes . We can use it to connect to the database , perform SQL Statements, etc. .
What is? JDBC Connect ? How to get the database /JDBC Connect ?
JDBC A connection is a session established between the host and the database server .
obtain JDBC Linking is mainly divided into two steps :
1. Register and load the driver . call Class.forName() Method . The driver class will be registered to DriverManager Class , And load it into memory .
2. call DriverManager Class getConnection Method . Incoming database connection url, user name , password , You can get the connection object .
JDBC How to achieve Java Procedure and JDBC Driven loosely coupled ?
There is only one case , Will be involved JDBC drive , Is the use Class.forName Reflection mechanism to register and load drivers .
All other operations are Java Program call JDBC Interface to complete . In this way Applications and The driver Isolation , If you want to change the database, it becomes simple .
JDBC Steps to connect to the database ? Operate on data ?
- Register and load the driver .
- Use DriverManager Get the connection .
- precompile sql sentence , return PreparedStatement.
- Fill in placeholders .
- Perform database operations .
- Processing result set ResultSet.
- close resource .
边栏推荐
- Intelligent robots and intelligent systems (Professor Zheng Zheng of Dalian University of Technology) -- 2. Mobile Robot Perception
- 【golang从入门到实践】学生成绩管理系统
- Solve the problem that Anaconda navigator cannot be opened
- FPGA integrated project - image edge detection system
- [matlab] (IV) application of MATLAB in linear algebra
- *Code understanding * common function parsing in pytoch
- Draw a circular radar chart with canvas
- P1739表达式括号匹配题解
- (dkby) DFL learning notes
- Error lnk2019: unresolved external symbol [email protected]
猜你喜欢

What is the NFT concept.. Fully understand NFT market, technology and cases

EZDML逆向工程导入数据库分析实操教程

*Yolo5 learning * data experiment based on yolo5 face combined with attention model se

【游戏合集】手机都要被塞爆了,6款优质Pygame游戏合集降临~(附源码)
![[matlab] (IV) application of MATLAB in linear algebra](/img/c8/97fddb4105008990173247b1b4a155.png)
[matlab] (IV) application of MATLAB in linear algebra

【MySQL】08:聚合函数

Learning to track at 100 FPS with deep progression networks

Wechat payment V3 version of openresty implementation and pit avoidance Guide (service side)

QT | string generation QR code function

Error reported by Nacos: error Nacos failed to start, please see d:\nacos\logs\nacos log for more details.
随机推荐
Detailed notes on pytoch building neural network
P1135 奇怪的电梯题解
Shared lock, exclusive lock, mutex lock, pessimistic lock, optimistic lock, row lock, table lock, page lock, non repeatable read, lost modification, read dirty data
Figure New Earth: how the RVT format BIM model modeled by Revit can accurately match the map with texture
[interview] Why do you need foreach with the for cycle?
POJ3278抓住那头牛题解
[wechat applet development (II)] custom navigation bar
Implementation of unity hub free version
Case practice - panoramic image mosaic: feature matching method
55. Jumping game
As skillfully uses idea annotation to improve collaboration / development efficiency
【golang从入门到实践】学生成绩管理系统
Android kotlin uses a coroutine instead of a callback function (suspendcoroutine usage)
jmeter中JSON提取器使用
Kotlin coroutine (I): foundation and deepening
You can't access this shared folder because your organization's security policies prevent unauthenticated guests from accessing it. These policies can help protect your computer from unsafe or malicio
Recognition and storage of Graphs
Adaptive problem of img aspect ratio scaling in flex layout in Safari
Saining Techtalk attack and defense drill: attack combination fist "stable, accurate and ruthless" penetration
The vision group of Hegong University Sky team trained Day1 - machine learning, and learned to use the Yolo model