随笔分类 - 数据库
摘要:这个这个,我必须花巨大篇幅,记录下今天清空表记录的英雄壮举,可知道一个drop操作,执行了一下午啊一下午,这是要急出翔的节奏。。呵呵,下面开始我的需求:某表因历史原因,积压了1亿条记录,约占360G空间。我要清掉它,就是这么简单。尝试1:作为DB小菜,首先想到的,当然是delete命令。于是欢快的执行了delete from mytable; 知道吗?一杯茶都喝完了,它还没有执行完。我的尊严受到了挑战,捉急了,开始google。尝试2:好,换用truncate命令。truncate table mytable; 知道吗?第二坏茶喝完了,它还没有执行完。快急出翔了,继续google。尝试3:..
阅读全文
摘要:MySQL和Oracle在ID方面,有何异同?占位,该篇要在学习中不断展开的说。
阅读全文
摘要:1. 数据库 1: show databases; 2: 3: use DB_NAME; 4: 5: create database DB_NAME; 6: 2. 表 1: show tables; 2: 3: create table TABLE_NAME ; //清单2 4: 5: describe TABLE_NAME ; 6: 7: select * from TABLE_NAME ; 8: 9: insert into TABLE_NAME values (’xxx’,’xxx’,’xxx’,’xxx’)...
阅读全文
摘要:There are two patterns of Derby, Embedded and Network Server.Pattern I: how to connect to the database?1. load the embedded driver;2. wanna create a DB? then set some properites;3. create and connect to the database using DriverManager; how to operate on the DB?1. create a statement from the connect
阅读全文
摘要:Simple demo of accessing DB using JNDI.How to get the connection? 1. get context;2. lookup for datasource config;3. get connection from this datasource;How to execute SQL? 1. declear SQL String;2. transform sql into statment on the connection we have got;3. execute the statement to get the result se
阅读全文

浙公网安备 33010602011771号