Category Archives: 其他技术

靠代码吃饭..

Derby: Create auto-increment Column 创建自增Column

Similar to Microsoft SQL Server, Derby supports IDENTITY columns to help you creating auto-incremented sequence values for primary key columns. Derby offers two variations of IDENTITY columns:

  • “GENERATED ALWAYS AS IDENTITY” – Derby always provides auto-incremented sequence values to this column. You are not allowed to specify your own values. 由Derby负责提供自增的主键值, 该值不允许插入.
  • “GENERATED BY DEFAULT AS IDENTITY” – Derby provides auto-incremented sequence values to this as default only when you are not providing values. 仅在未提供主键值时, 由Derby负责插入.
  • 相比BY ALWARYS, BY DEFAULT可Insert主键值.

我们将通过上述方法增加自增Column.

More…

Posted in DB | Tagged | Leave a comment

Derby : Create/Rename/Drop Index

  1. Create Index 创建, See: CREATE INDEX statement
    CREATE INDEX Employee_employee_ID_IDX ON Employee4(employee_ID);
  2. Rename Index 重命名, See: RENA

More…

Posted in DB | Tagged | Leave a comment

Derby 新手入门

Apache Derby, an Apache DB subproject, is an open source relational database implemented entirely in Java and available under the Apache License, Version 2.0.

前年刚学Air时那会儿摆弄过一阵子的SQLLite, 这个也是基于文件的可嵌入的小型关系数据库 – 体积小 功能可都不小.

随便写写这几天入门Derby的过程.

More…

Posted in DB | Tagged | Leave a comment

使用SQuirreL(Universal) SQL Client管理Derby数据库

Java写的通过JDBC操作不同数据库的Swing应用, 功能强大, 支持多数数据库:

image

More…

Posted in DB | Tagged , , | 1 Comment

Derby: Show Tables – Get get existing tables 获取所有表

Derby并为提供对Show Tables的支持, 但可通过如下方式获取所有Table:
Get existing table names 获得已有Table名称列表
SELECT TABLENAME FROM SYS.SYSTABLES WHERE TABLETYPE='T';
Check Ta

More…

Posted in DB | Tagged | Leave a comment