-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathmetaDB.java
More file actions
56 lines (42 loc) · 1.47 KB
/
Copy pathmetaDB.java
File metadata and controls
56 lines (42 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package common;
/*
* Date: 12-3-31
*/
import gudusoft.gsqlparser.IMetaDatabase;
public class metaDB implements IMetaDatabase {
String columns[][] = {
{"server","db","dbo","aTab","Quantity3"},
{"server","db","dbo","bTab","Quantity2"},
{"server","db","dbo","cTab","Quantity"}
};
public boolean checkColumn(String server, String database,String schema, String table, String column){
boolean bServer,bDatabase,bSchema,bTable,bColumn,bRet = false;
for (int i=0; i<columns.length;i++){
if ((server == null)||(server.length() == 0)){
bServer = true;
}else{
bServer = columns[i][0].equalsIgnoreCase(server);
}
if (!bServer) continue;
if ((database == null)||(database.length() == 0)){
bDatabase = true;
}else{
bDatabase = columns[i][1].equalsIgnoreCase(database);
}
if (!bDatabase) continue;
if ((schema == null)||(schema.length() == 0)){
bSchema = true;
}else{
bSchema = columns[i][2].equalsIgnoreCase(schema);
}
if (!bSchema) continue;
bTable = columns[i][3].equalsIgnoreCase(table);
if (!bTable) continue;
bColumn = columns[i][4].equalsIgnoreCase(column);
if (!bColumn) continue;
bRet =true;
break;
}
return bRet;
}
}