1 19 20 package org.netbeans.modules.j2ee.persistence.editor.completion.db; 21 22 import java.sql.ResultSet ; 23 import org.netbeans.modules.db.test.jdbcstub.JDBCStubUtil; 24 import org.netbeans.test.stub.api.StubDelegate; 25 26 32 public class SimpleDatabaseMetaDataImpl extends StubDelegate { 33 34 private String [] catalogNames; 35 private String [] schemaNames; 36 private String [][] tableNamesBySchema; 37 38 public SimpleDatabaseMetaDataImpl(String [] catalogNames) { 39 this.catalogNames = catalogNames; 40 } 41 42 public SimpleDatabaseMetaDataImpl(String [] catalogNames, String [] schemaNames, String [][] tableNamesBySchema) { 43 this.catalogNames = catalogNames; 44 this.schemaNames = schemaNames; 45 this.tableNamesBySchema = tableNamesBySchema; 46 } 47 48 public ResultSet getCatalogs() { 49 return JDBCStubUtil.catalogsResultSet(catalogNames); 50 } 51 52 public ResultSet getSchemas() { 53 return JDBCStubUtil.schemasResultSet(schemaNames); 54 } 55 56 public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String [] types) { 57 return JDBCStubUtil.tablesResultSet(tableNamesBySchema); 58 } 59 60 public void setCatalogs(String [] catalogNames) { 61 this.catalogNames = catalogNames; 62 } 63 64 public void setTables(String [][] tableNamesBySchema) { 65 this.tableNamesBySchema = tableNamesBySchema; 66 } 67 } 68 | Popular Tags |