您好,欢迎来到尔游网。
搜索
您的当前位置:首页How to get the tables of one schema?

How to get the tables of one schema?

来源:尔游网
	public ArrayList<Properties> doGetDBTable(String schemaName) throws Exception
	{
		java.sql.DatabaseMetaData meta = conn.getMetaData();
	    java.sql.ResultSet schemas = meta.getTables(null, schemaName.toUpperCase(), "%", new String[] {"Table"});

	    ArrayList<Properties> list = new ArrayList<Properties>();
	    
	    
	    
	    while (schemas.next()) 
	    {       
	    	Properties p = new Properties();
	    	String table = schemas.getString(3);   
	    	String tableSchema = schemas.getString(2); 

	    	p.setProperty("Table", tableSchema+"."+table);
	    	
	    	list.add(p);
	    }
	    
	    return list;
	}


因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- axer.cn 版权所有 湘ICP备2023022495号-12

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务