-
Notifications
You must be signed in to change notification settings - Fork 0
/
Metadata.patch
30 lines (30 loc) · 1.01 KB
/
Metadata.patch
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
22a23
> import java.util.ArrayList;
78a80,82
> private final static String SELECT_COLUMNS="SELECT DISTINCT c.COLUMN_NAME,c.ORIGINAL_TYPE IN('COUNTER','GUID') as IS_AUTOINCREMENT, c.ORIGINAL_TYPE='MONEY' as IS_CURRENCY " +
> " FROM UCA_METADATA.COLUMNS c INNER JOIN UCA_METADATA.TABLES t " +
> " ON(t.TABLE_ID=c.TABLE_ID ) WHERE t.ESCAPED_TABLE_NAME=nvl(?,t.ESCAPED_TABLE_NAME) ";
218a223,245
> }
>
> public ArrayList<String> getColumnNames(String tableName) throws SQLException {
> PreparedStatement ps = null;
> try {
> boolean camb = SYSTEM_SUBQUERY.equals(tableName);
> tableName = camb ? null : tableName;
> ps = conn.prepareStatement(SELECT_COLUMNS);
> ps.setString(1, tableName);
> ResultSet rs = ps.executeQuery();
> ArrayList<String> result = new ArrayList<String>();
> while (rs.next()) {
> result.add(rs.getString("COLUMN_NAME"));
> }
> if (!camb) {
> return result;
> }
> return null;
> } finally {
> if (ps != null) {
> ps.close();
> }
> }