1 | public class H2TableIndexExtractorImpl implements ITableIndexExtractor {↵ | | 1 | public class MysqlTableTriggerExtractorImpl implements ITableTriggerExtractor {↵
|
|
2 | ↵ | | |
|
3 | /** Logger for this class */↵ | | 2 | /** Logger for this class */↵
|
4 | private final static ILogger s_log = ↵ | | 3 | private final static ILogger s_log = ↵
|
5 | LoggerController.createLogger(H2TableIndexExtractorImpl.class);↵ | | 4 | LoggerController.createLogger(MysqlTableTriggerExtractorImpl.class);↵
|
6 | ↵ | | 5 | ↵
|
7 | ↵ | | 6 | ↵
|
8 | /** The query that finds the indexes for a given table */↵ | | 7 | /** The query that finds the trigger definition */↵
|
9 | private static final String query = ↵ | | 8 | private static String SQL = ↵
|
10 | "SELECT INDEX_NAME " +↵ | | 9 | "select TRIGGER_NAME " +↵
|
11 | "FROM INFORMATION_SCHEMA.INDEXES " +↵ | | 10 | "↵
|
12 | "WHERE TABLE↵ | | 11 | from information_schema.triggers " +↵
|
13 | _SCHEMA = ? " +↵ | | 12 | "where EVENT_OBJECT_SCHEMA = ? " +↵
|
14 | "AND TABLE_NAME = ? ";↵ | | 13 | "and EVENT_OBJECT_TABLE = ? ";↵
|
15 | ↵ | | 14 | ↵
|
16 | /**↵ | | 15 | /**↵
|
17 | * @see net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableIndexExtractor#bindParamters(java.sql.PreparedStatement, net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo)↵ | | 16 | * @see net.sourceforge.squirrel_sql.plugins.derby.exp.ITableTriggerExtractor#bindParamters(java.sql.PreparedStatement, net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo)↵
|
18 | */↵ | | 17 | */↵
|
19 | public void bindParamters(PreparedStatement pstmt, IDatabaseObjectInfo dbo)↵ | | 18 | public void bindParamters(PreparedStatement pstmt, IDatabaseObjectInfo dbo) ↵
|
20 | throws SQLException ↵ | | 19 | throws SQLException ↵
|
21 | {↵ | | 20 | {↵
|
22 | if (s_log.isDebugEnabled()) {↵ | | 21 | if (s_log.isDebugEnabled()) {↵
|
23 | s_log.debug("Binding schema name "+dbo.getSchemaName()+↵ | | 22 | s_log.debug("Binding catalog name "+dbo.getCatalogName()+↵
|
24 | " as first bind value");↵ | | 23 | " as first bind value");↵
|
25 | s_log.debug("Binding table name "+dbo.getSimpleName()+↵ | | 24 | s_log.debug("Binding table name "+dbo.getSimpleName()+↵
|
26 | " as second bind value"); ↵ | | 25 | " as second bind value"); ↵
|
27 | } ↵ | | 26 | }↵
|
28 | pstmt.setString(1, dbo.getSchemaName());↵ | | 27 | pstmt.setString(1, dbo.getCatalogName());↵
|
29 | pstmt.setString(2, dbo.getSimpleName());↵ | | 28 | pstmt.setString(2, dbo.getSimpleName()); ↵
|
30 | }↵ | | 29 | }↵
|
|
31 | /**↵ | | 30 | /**↵
|
32 | * @see net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableIndexExtractor#getTableIndexQuery()↵ | | 31 | * @see net.sourceforge.squirrel_sql.plugins.derby.exp.ITableTriggerExtractor#getTableTriggerQuery()↵
|
33 | */↵ | | 32 | */↵
|
34 | public String getTableIndexQuery() {↵ | | 33 | public String getTableTriggerQuery() {↵
|
35 | return query | | 34 | return SQL
|