DataBase
共 2 篇文章
JDBC性能优化笔记
这部分与jdbc无关,是对于mysql优化的普通技巧 利用查询缓存。不要把函数直接写在sql语句里; 当只需要一条记录时查询加上LIMIT 1; 尽量避免SELECT *这样写; 用连接池; 建索引; 更多关于mysql的优化 MySQL性能优化的最佳20+条经验 完全优化MySQL数据库性能的八大巧方法 jdbc的优化: 尽量少用元数据方法; 尽量避免null。mysql中对值为null情况花费更多的空间和处理而加重负担,应该指定专门的值来表示空值,在方法调用时传参也要避免null; 善用哑查询。在仅想得到表信息等而不需要返回记录的情况下,使用“select * from tableNam…
JDBC编程步骤
1. Load the Driver 1. Class.forName() | Class.forName().newInstance() | new DriverName() 2. 实例化时自动向DriverManager注册,不需显式调用DriverManager.registerDriver方法 2. Connect to the DataBase DriverManager.getConnection() 3. Execute the SQL 1. Connection.CreateStatement() 2. Statement.executeQuery() 3. Statemen…