@@ -0,0 +1,1641 @@
+/**%0A * %0A */%0Apackage org.gprom.jdbc.metadata_lookup;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.SQLException;%0Aimport java.sql.Statement;%0A%0Aimport org.apache.log4j.Logger;%0Aimport org.gprom.jdbc.jna.GProM_JNA.GProMMetadataLookupPlugin;%0Aimport org.gprom.jdbc.jna.GProM_JNA.GProMMetadataLookupPlugin.databaseConnectionClose_callback;%0Aimport org.gprom.jdbc.jna.GProM_JNA.GProMMetadataLookupPlugin.databaseConnectionOpen_callback;%0Aimport org.gprom.jdbc.metadata_lookup.postgres.PostgresCatalogLookup;%0Aimport org.gprom.jdbc.utility.LoggerUtil;%0A%0A/**%0A * @author lord_pretzel%0A *%0A */%0Apublic class AbstractMetadataLookup %7B%0A%0A%09private static Logger log = Logger.getLogger(PostgresCatalogLookup.class);%0A%09protected GProMMetadataLookupPlugin plugin;%0A%09private Connection con;%0A%09private Statement stat;%0A%0A%09public AbstractMetadataLookup(Connection con) throws SQLException %7B%0A%09%09this.con = con;%0A%09%09createPlugin();%0A%09%7D%0A%0A%09/**%0A%09 * %0A%09 */%0A%09private void createPlugin() %7B%0A%09%09plugin = new GProMMetadataLookupPlugin ();%0A%09%09plugin.databaseConnectionClose= new databaseConnectionClose_callback() %7B%0A%0A%09%09%09@Override%0A%09%09%09public int apply() %7B%0A%09%09%09%09return closeConnection();%0A%09%09%09%7D%0A%09%09%09%0A%09%09%7D;%0A%09%09plugin.databaseConnectionOpen = new databaseConnectionOpen_callback() %7B%0A%0A%09%09%09@Override%0A%09%09%09public int apply() %7B%0A%09%09%09%09return openConnection();%0A%09%09%09%7D%0A%09%09%09%0A%09%09%7D;%0A%09%7D%0A%0A%09private int openConnection () %7B%0A%09%09try %7B%0A%09%09%09stat = con.createStatement();%0A%09%09%09return 0;%0A%09%09%7D%0A%09%09catch (SQLException e) %7B%0A%09%09%09LoggerUtil.logException(e, log);%0A%09%09%09return 1;%0A%09%09%7D%0A%09%7D%0A%09%0A%09%0A%09private int closeConnection () %7B%0A%09%09try %7B%0A%09%09%09stat.close();%0A%09%09%09return 0;%0A%09%09%7D%0A%09%09catch (SQLException e) %7B%0A%09%09%09LoggerUtil.logException(e, log);%0A%09%09%09return 1;%0A%09%09%7D%0A%09%7D%0A%09%0A%7D%0A

add source