01: /*
02: * Created on Oct 16, 2004
03: *
04: * TODO To change the template for this generated file go to
05: * Window - Preferences - Java - Code Style - Code Templates
06: */
07: package org.hammurapi.inspectors.metrics;
08:
09: import java.sql.SQLException;
10:
11: import org.hammurapi.HammurapiException;
12: import org.hammurapi.InspectorContext;
13:
14: import com.pavelvlasov.persistence.CompositeStorage;
15: import com.pavelvlasov.review.SourceMarker;
16: import com.pavelvlasov.sql.JdbcStorage;
17: import com.pavelvlasov.sql.SQLProcessor;
18:
19: /**
20: * @author 111001082
21: *
22: * TODO To change the template for this generated type comment go to
23: * Window - Preferences - Java - Code Style - Code Templates
24: */
25: public class SqlExtractorHyperSonicDb {
26:
27: public InspectorContext context = null;
28:
29: protected SQLProcessor getProcessor(SourceMarker marker) {
30: JdbcStorage jdbcStorage = (JdbcStorage) ((CompositeStorage) context
31: .getSession().getStorage())
32: .getStorage(JdbcStorage.class);
33: if (jdbcStorage == null) {
34: context.warn(marker, "Could not obtain JdbcStorage");
35: return null;
36: } else {
37: return jdbcStorage.getProcessor();
38: }
39: }
40:
41: }
|