当前位置:网站首页>The Statement update Statement execution
The Statement update Statement execution
2022-08-02 00:18:00 【Camellia——】
package com.lin.jdbc_01;import java.sql.Connection;import java.sql.DriverManager;import java.sql.Statement;/** Use Statement to operate DML, updata statement* */public class JdbcDemo1 {public static void main(String[] args) throws Exception {//1) Register the driverClass.forName("com.mysql.jdbc.Driver");// 2) Get the database connection objectConnection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb_01", "root", "123456");// 3) Prepare sqlString sql="update stu set name='Wang Wu' where id=4;";// 4) Create an execution objectStatement stmt=conn.createStatement();// 5) executeint count=stmt.executeUpdate(sql);System.out.println(count);// 6) Release resourcesstmt.close();conn.close();}}边栏推荐
猜你喜欢

QML package management

QML包管理
![[Headline] Written test questions - minimum stack](/img/67/08f2be8afc780e3848371a1b5e04db.png)
[Headline] Written test questions - minimum stack

如何重装Win11?一键重装Win11方法

Using the "stack" fast computing -- reverse polish expression

【解决】win10下emqx启动报错Unable to load emulator DLL、node.db_role = EMQX_NODE__DB_ROLE = core

Unity—四元数、欧拉角API+坐标系统

IP Core: FIFO

SphereEx苗立尧:云原生架构下的Database Mesh研发实践

Axure tutorial - the new base (small white strongly recommended!!!)
随机推荐
SphereEx Miao Liyao: Database Mesh R&D Practice under Cloud Native Architecture
GIF making - very simple one-click animation tool
easy-excel 解决百万数据导入导出,性能很强
JSP 如何获取request对象中的路径信息呢?
Async/await principle and execution sequence analysis
[Headline] Written test questions - minimum stack
JSP out.println()方法具有什么功能呢?
GetHashCode方法与=
C language Qixi is coming!It's time to show the romance of programmers!
contentEditable属性
A simple file transfer tools
接地气讲解TCP协议和网络程序设计
TCL:在Quartus中使用tcl脚本语言进行管脚约束
REST会消失吗?事件驱动架构如何搭建?
els 方块边界变形处理
mysql8安装make报错如何解决
Play NFT summer: this collection of tools is worth collecting
回顾历史5次经济衰退时期:这一次可能会有何不同?
LeetCode_518_零钱兑换Ⅱ
众筹DAO“枯萎”的缩影:曾拍下《沙丘》未出版手稿的Spice DAO解散