oracle 枚举_枚举导出为sql语句java实现
生活随笔
收集整理的這篇文章主要介紹了
oracle 枚举_枚举导出为sql语句java实现
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
//運(yùn)行main方法,拷貝控制臺輸出的內(nèi)容,就是sql語句了,放到oracle執(zhí)行插入(sql僅供參考,具體看自己的表結(jié)構(gòu))public static void main(String[] args) {CheckFileSysStatus[] enums = CheckFileSysStatus.values(); System.out.println("INSERT INTO T_A_REASON_DICTIONARY VALUES ('1', '0', '已發(fā)布', null, '1', '1', null, null, null, null, null, null, null);"); System.out.println("INSERT INTO T_A_REASON_DICTIONARY VALUES ('2', '1', '已廢棄', null, '1', '1', null, null, null, null, null, null, null);"); int i=3; for (CheckFileSysStatus direction : enums) { System.out.println("INSERT INTO T_A_REASON_DICTIONARY VALUES ('"+i+"', '"+direction.getCode()+"', '"+direction.getMsg()+"', null, '1', '1', null, null, null, null, null, null, null);"); i++; }}//枚舉參考enum CheckFileSysStatus { /** * 初始化數(shù)據(jù) */ UPLOAD_INIT(0, "初始化數(shù)據(jù)"), /** * 作廢 */ UPLOAD_CANCEL(1, "文件作廢"), NULL(-1, ""); /** * 返回狀態(tài)碼 */ private int code; /** * 返回狀態(tài)信息 */ private String msg; CheckFileSysStatus(int code, String msg) { this.code = code; this.msg = msg; } public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public String toString() { return "{"code":"" + this.code + "","msg":"" + this.msg + ""}"; }}
總結(jié)
以上是生活随笔為你收集整理的oracle 枚举_枚举导出为sql语句java实现的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 红箭-10反坦克导弹
- 下一篇: js 点击最后一个 和倒数第二个_期货及