随笔分类 -  数据库

摘要:JDBC // JDBC连接mysql的一般步骤 // 1. 注册驱动 Class.forName("com.mysql.cj.jdbc.Driver"); // 2. 获取连接 String url = "jdbc:mysql://127.0.0.1:3306/db1"; // 连接mysql下的 阅读全文
posted @ 2023-01-10 17:14 Dre_am_tale 阅读(50) 评论(0) 推荐(0)
摘要:MySQL常用操作 登录 mysql -uroot -p密码 DDL 查询 show databases; # 查询目前有哪几个数据库 show tables; # 查询当前数据库中有哪些表 desc tablename; # 查询某张表的结构 describe table 创建 create DA 阅读全文
posted @ 2023-01-07 16:49 Dre_am_tale 阅读(39) 评论(0) 推荐(0)
摘要:Java如何像C++一样删除对象 You should remove the references to it by assigning null or leaving the block where it was declared. After that, it will be automatic 阅读全文
posted @ 2022-04-12 14:52 Dre_am_tale 阅读(1563) 评论(0) 推荐(0)
摘要:JDBC 数据库连接与使用 //连接Mysql数据库 import java.sql.*; import java.util.Scanner; public class sqlsearch { static final String JDBC_DRIVER = "com.mysql.jdbc.Dri 阅读全文
posted @ 2022-01-26 16:46 Dre_am_tale 阅读(56) 评论(0) 推荐(0)