mysql和oracle字段,Oracle 和 Mysql 数据库表字段对比讲解

oracle 和 mysql 表字段对比讲解

oracle select * from user_tab_columns

0a4419e34c300c4f42af235300016a52.png

oracle可以通过user_tab_columns查询相关表结构信息

mysql select * from information_schema.columns

f72b68c0fa165cd0a755e4c54308e4ea.png

oracle可以通过information_schema.columns查询相关表结构信息

如果有多张表可将他们带条件查询where table_name in('表名1','表名2')查询最终结果用excl保存起来

c043c6fe37af9b451cdfd2699df4473c.png

类似这张

接着java用poi写文件流

public map getexclmap(string templatefilepath){

文件templatefile =新文件(templatefilepath);

hssfworkbook workbookout = null;

map tabmap1 = new hashmap <>();

尝试{

fileinputstream inputstream = new fileinputstream(templatefile);

workbookout = new hssfworkbook(inputstream);

hssfsheet sheetout = workbookout.getsheetat(0);

int rows = sheetout.getlastrownum(); //得到excl最后一行下标

//第一次循环将表名作为关键值

for(int i = 0; i <= rows; i ++){

字符串tabnamestr = sheetout.getrow(i).getcell(1).getstringcellvalue();

tabnamestr = tabnamestr.touppercase(); //防止大小写不一致

tabmap1.put(tabnamestr,new arraylist());

}

//第二次循环将字段放值

for(int i = 0; i <= rows; i ++){

字符串tabnamestr = sheetout.getrow(i).getcell(1).getstringcellvalue();

tabnamestr = tabnamestr.touppercase();

string clumstr = sheetout.getrow(i).getcell(2).getstringcellvalue();

clumstr = clumstr.touppercase();

tabmap1.get(tabnamestr).add(clumstr);

}

} catch(exception e){

e.printstacktrace();

}

system.out.println(“templatefilepath = [”+ count +“]”);

返回tabmap1;

}

比较方法

public static void main(string [] args){

utilexcl utilexcl =新的utilexcl();

映射an50 = utilexcl.getexclmap(“d:\\ users \\ user \\ desktop \\ marclums \\ an50.xls”); // 65

map ship79 = utilexcl.getexclmap(“d:\\ users \\ user \\ desktop \\ marclums \\ ship79.xls”); // 65

string [] tabs = utilexcl.gettabs();

int coun = 0;

//测试ship79有50没有的表或字段

//循环79键

for(对象键:ship79.keyset()){

//判断是否包含键也就得到了不包含的表名

如果(an50.containskey(键)){

arraylist key50list =(arraylist )an50.get(key);

arraylist key79list =(arraylist )ship79.get(key);

//同第一个循环自行理解

for(int i = 0; i

最后希望大家喜欢如果是同类型数据库建议通过上面的表大写写sql个人sql写的不是很好

也就不给上面sql方案了

希望与广大网友互动??

点此进行留言吧!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值