1 19 20 package org.netbeans.modules.j2ee.persistence.editor.completion.db; 21 22 import java.sql.SQLException ; 23 import org.netbeans.modules.dbschema.TableElement; 24 import org.netbeans.modules.j2ee.persistence.editor.completion.*; 25 26 30 public class DBMetaDataUtils { 31 32 private DBMetaDataUtils() { 33 assert false; 34 } 35 36 public static Schema getSchema(DBMetaDataProvider provider, String catalogName, String schemaName) throws SQLException { 37 Catalog catalog = provider.getCatalog(catalogName); 38 if (catalog != null) { 39 return catalog.getSchema(schemaName); 40 } 41 return null; 42 43 } 44 45 public static TableElement getTable(DBMetaDataProvider provider, String catalogName, String schemaName, String tableName) throws SQLException { 46 Schema schema = getSchema(provider, catalogName, schemaName); 47 if (schema != null) { 48 return schema.getTable(tableName); 49 } 50 return null; 51 } 52 } 53 | Popular Tags |