I want to write a SpringBatch Tasklet, that automatically activates or de-activates all indexes for a given database table. The code needs to work independantly of the DBMS (SQL Server, Oracle and HSQLDB are required).
This is what I have tried so far:
DatabaseMetaData dbMetaData = connection.getMetaData();
ResultSet rs = dbMetaData.getIndexInfo(null, null, tableName, true, false);
while (rs.next()) {
// work with ResultSet
}
However, I do not get the names of the Indexes or any useful information.
So could anyone give some hints on how to set all indexes of table to active or inactive with just a JDBC connection object?
Are your sure you can't reconsider your desing? Which is your needs? – Luca Basso Ricci Jan 09 '14 at 07:24