[Squirrel-sql-commits] sql12/plugins/firebird/src/org/firebirdsql/squirrel/tab BasePreparedStatement
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
From: Colin B. <co...@us...> - 2004-06-09 00:24:27
|
Update of /cvsroot/squirrel-sql/sql12/plugins/firebird/src/org/firebirdsql/squirrel/tab In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18916/plugins/firebird/src/org/firebirdsql/squirrel/tab Added Files: BasePreparedStatementTab.java BaseSourceTab.java DomainDetailsTab.java GeneratorDetailsTab.java I18NStrings.properties IndexInfoTab.java ProcedureSourceTab.java TriggerDetailsTab.java TriggerSourceTab.java ViewSourceTab.java Log Message: New plugin --- NEW FILE: TriggerDetailsTab.java --- package org.firebirdsql.squirrel.tab; /* * Copyright (C) 2002 Colin Bell * co...@us... * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ import java.sql.PreparedStatement; import java.sql.SQLException; import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo; import net.sourceforge.squirrel_sql.fw.util.log.ILogger; import net.sourceforge.squirrel_sql.fw.util.log.LoggerController; import net.sourceforge.squirrel_sql.client.session.ISession; /** * This class will display the details for an Oracle trigger. * * @author <A HREF="mailto:co...@us...">Colin Bell</A> */ public class TriggerDetailsTab extends BasePreparedStatementTab { /** * This interface defines locale specific strings. This should be * replaced with a property file. */ private interface i18n { String TITLE = "Details"; String HINT = "Display trigger details"; } /** SQL that retrieves the data. */ private static String SQL = "select rdb$trigger_name, " + "rdb$trigger_sequence, " + "case rdb$trigger_type " + " when 1 then 'BEFORE INSERT' " + " when 2 then 'AFTER INSERT' " + " when 3 then 'BEFORE UPDATE' " + " when 4 then 'AFTER UPDATE' " + " when 5 then 'BEFORE DELETE' " + " when 6 then 'AFTER DELETE' " + " else 'UNKNOWN TYPE' || rdb$trigger_type " + "end as rdb$trigger_type, " + "case rdb$trigger_inactive " + " when 0 then 'ACTIVE' " + " when 1 then 'INACTIVE' " + " else 'UNKNOWN' " + "end as rdb$trigger_active, " + "rdb$description " + "from rdb$triggers where " + " rdb$trigger_name = ?"; /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(TriggerDetailsTab.class); public TriggerDetailsTab() { super(i18n.TITLE, i18n.HINT, true); } protected PreparedStatement createStatement() throws SQLException { ISession session = getSession(); PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL); IDatabaseObjectInfo doi = getDatabaseObjectInfo(); pstmt.setString(1, doi.getSimpleName()); return pstmt; } } --- NEW FILE: DomainDetailsTab.java --- package org.firebirdsql.squirrel.tab; /* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ import java.sql.PreparedStatement; import java.sql.SQLException; import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo; import net.sourceforge.squirrel_sql.fw.util.log.ILogger; import net.sourceforge.squirrel_sql.fw.util.log.LoggerController; import net.sourceforge.squirrel_sql.client.session.ISession; /** * This class will display the details for an Oracle sequence. * * @author <A HREF="mailto:co...@us...">Colin Bell</A> */ public class DomainDetailsTab extends BasePreparedStatementTab { /** SQL that retrieves the data. */ private static String SQL = "select rdb$field_name, " + "rdb$validation_source, " + "rdb$computed_source, " + "rdb$default_source, " + "rdb$field_length, " + "rdb$field_scale, " + "rdb$field_type, " + "rdb$field_sub_type, " + "rdb$missing_source, " + "rdb$edit_string, " + "rdb$character_length, " + "rdb$collation_name, " + "rdb$character_set_name, " + "rdb$field_precision " + "rdb$description " + "from rdb$fields f " + "left outer join rdb$character_sets cs on cs.rdb$character_set_id = f.rdb$character_set_id " + "left outer join rdb$collations cl on (cl.rdb$collation_id = f.rdb$collation_id and cl.rdb$character_set_id = f.rdb$character_set_id) " + "where " + " rdb$field_name = ?"; /** * This interface defines locale specific strings. This should be * replaced with a property file. */ private interface i18n { String TITLE = "Details"; String HINT = "Display domain details"; } /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(DomainDetailsTab.class); public DomainDetailsTab() { super(i18n.TITLE, i18n.HINT, true); } protected PreparedStatement createStatement() throws SQLException { ISession session = getSession(); IDatabaseObjectInfo doi = getDatabaseObjectInfo(); PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL); pstmt.setString(1, doi.getSimpleName()); return pstmt; } } --- NEW FILE: BaseSourceTab.java --- package org.firebirdsql.squirrel.tab; import java.awt.BorderLayout; import java.awt.Component; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import net.sourceforge.squirrel_sql.fw.util.log.ILogger; import net.sourceforge.squirrel_sql.fw.util.log.LoggerController; import net.sourceforge.squirrel_sql.client.session.ISession; import net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.BaseObjectTab; public abstract class BaseSourceTab extends BaseObjectTab { /** * This interface defines locale specific strings. This should be * replaced with a property file. */ private interface i18n { String TITLE = "Source"; } /** Hint to display for tab. */ private final String _hint; /** Component to display in tab. */ private BaseSourcePanel _comp; /** Scrolling pane for <TT>_comp. */ private JScrollPane _scroller; /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(BaseSourceTab.class); public BaseSourceTab(String hint) { super(); _hint = hint != null ? hint : i18n.TITLE; } /** * Return the title for the tab. * * @return The title for the tab. */ public String getTitle() { return i18n.TITLE; } /** * Return the hint for the tab. * * @return The hint for the tab. */ public String getHint() { return _hint; } public void clear() { } public Component getComponent() { if (_comp == null) { _comp = new BaseSourcePanel(); _scroller = new JScrollPane(_comp); } return _scroller; } protected void refreshComponent() { ISession session = getSession(); if (session == null) { throw new IllegalStateException("Null ISession"); } try { PreparedStatement pstmt = createStatement(); try { _comp.load(getSession(), pstmt); } finally { try { pstmt.close(); } catch (SQLException ex) { s_log.error(ex); } } } catch (SQLException ex) { s_log.error(ex); session.getMessageHandler().showErrorMessage(ex); } } protected abstract PreparedStatement createStatement() throws SQLException; private final class BaseSourcePanel extends JPanel { private JTextArea _ta; BaseSourcePanel() { super(new BorderLayout()); createUserInterface(); } void load(ISession session, PreparedStatement stmt) { _ta.setText(""); try { ResultSet rs = stmt.executeQuery(); StringBuffer buf = new StringBuffer(4096); while (rs.next()) { buf.append(rs.getString(1)); } _ta.setText(buf.toString()); _ta.setCaretPosition(0); } catch (SQLException ex) { session.getMessageHandler().showErrorMessage(ex); } } private void createUserInterface() { _ta = new JTextArea(); _ta.setEditable(false); add(_ta, BorderLayout.CENTER); } } } --- NEW FILE: I18NStrings.properties --- IndexInfoTab.err.noindex=Unable to find index {0} IndexInfoTab.hint=(Firebird) Show information about the selected Index IndexInfoTab.title=Firebird Info --- NEW FILE: ProcedureSourceTab.java --- package org.firebirdsql.squirrel.tab; /* * Copyright (C) 2002 Colin Bell * co...@us... * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ import java.sql.PreparedStatement; import java.sql.SQLException; import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo; import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; import net.sourceforge.squirrel_sql.fw.util.log.ILogger; import net.sourceforge.squirrel_sql.fw.util.log.LoggerController; import net.sourceforge.squirrel_sql.client.session.ISession; /** * This class will display the source for an Oracle trigger. * * @author <A HREF="mailto:co...@us...">Colin Bell</A> */ public class ProcedureSourceTab extends BaseSourceTab { /** SQL that retrieves the source of a stored procedure. */ private static String SQL = "select rdb$procedure_source from rdb$procedures" + " where rdb$procedure_name = ?"; /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(ProcedureSourceTab.class); public ProcedureSourceTab(String hint) { super(hint); } protected PreparedStatement createStatement() throws SQLException { final ISession session = getSession(); final IDatabaseObjectInfo doi = getDatabaseObjectInfo(); SQLConnection conn = session.getSQLConnection(); PreparedStatement pstmt = conn.prepareStatement(SQL); pstmt.setString(1, doi.getSimpleName()); return pstmt; } } --- NEW FILE: ViewSourceTab.java --- package org.firebirdsql.squirrel.tab; /* * Copyright (C) 2002 Colin Bell * co...@us... * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ import java.sql.PreparedStatement; import java.sql.SQLException; import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo; import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; import net.sourceforge.squirrel_sql.fw.util.log.ILogger; import net.sourceforge.squirrel_sql.fw.util.log.LoggerController; import net.sourceforge.squirrel_sql.client.session.ISession; /** * This class will display the source for an Oracle trigger. * * @author <A HREF="mailto:co...@us...">Colin Bell</A> */ public class ViewSourceTab extends BaseSourceTab { /** SQL that retrieves the source of a stored procedure. */ private static String SQL = "select rdb$view_source from rdb$relations" + " where rdb$relation_name = ?"; /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(ViewSourceTab.class); public ViewSourceTab(String hint) { super(hint); } protected PreparedStatement createStatement() throws SQLException { final ISession session = getSession(); final IDatabaseObjectInfo doi = getDatabaseObjectInfo(); SQLConnection conn = session.getSQLConnection(); PreparedStatement pstmt = conn.prepareStatement(SQL); pstmt.setString(1, doi.getSimpleName()); return pstmt; } } --- NEW FILE: IndexInfoTab.java --- package org.firebirdsql.squirrel.tab; /* * Copyright (C) 2004 Colin Bell * co...@us... * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetException; import net.sourceforge.squirrel_sql.fw.datasetviewer.IDataSet; import net.sourceforge.squirrel_sql.fw.datasetviewer.JavabeanDataSet; import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo; import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; import net.sourceforge.squirrel_sql.fw.util.StringManager; import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory; import net.sourceforge.squirrel_sql.client.session.ISession; import net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.BaseDataSetTab; import org.firebirdsql.squirrel.util.IndexInfo; import org.firebirdsql.squirrel.util.SystemTables; /** * This is the tab displaying information about an index. * * @author <A HREF="mailto:co...@us...">Colin Bell</A> */ public class IndexInfoTab extends BaseDataSetTab { /** Internationalized strings for this class. */ private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(IndexInfoTab.class); /** SQL that retrieves info about a stored procedure. */ private String SQL = "SELECT " + SystemTables.IIndexTable.COL_NAME + "," + SystemTables.IIndexTable.COL_DESCRIPTION + "," + SystemTables.IIndexTable.COL_ID + "," + SystemTables.IIndexTable.COL_RELATION_NAME + "," + SystemTables.IIndexTable.COL_UNIQUE + "," + SystemTables.IIndexTable.COL_SEGMENT_COUNT + "," + SystemTables.IIndexTable.COL_INACTIVE + "," + SystemTables.IIndexTable.COL_SYSTEM + "," + SystemTables.IIndexTable.COL_FOREIGN_KEY + "," + SystemTables.IIndexTable.COL_EXPRESSION_SOURCE + " FROM " + SystemTables.IIndexTable.TABLE_NAME + " WHERE " + SystemTables.IIndexTable.COL_NAME + " = ?"; /** * Return the title for the tab. * * @return The title for the tab. */ public String getTitle() { return s_stringMgr.getString("IndexInfoTab.title"); } /** * Return the hint for the tab. * * @return The hint for the tab. */ public String getHint() { return s_stringMgr.getString("IndexInfoTab.hint"); } /** * Create the <TT>IDataSet</TT> to be displayed in this tab. */ protected IDataSet createDataSet() throws DataSetException { return new JavabeanDataSet(createIndexInfo()); } private IndexInfo createIndexInfo() throws DataSetException { final ISession session = getSession(); final SQLConnection conn = session.getSQLConnection(); try { final IDatabaseObjectInfo doi = getDatabaseObjectInfo(); final PreparedStatement pstmt = conn.prepareStatement(SQL); pstmt.setString(1, doi.getSimpleName()); final ResultSet rs = pstmt.executeQuery(); try { if (rs.next()) { return new IndexInfo(rs.getString(1), rs.getString(2), rs.getInt(3), rs.getString(4), rs.getInt(5), rs.getInt(6), rs.getInt(7), rs.getInt(8), rs.getString(9), rs.getString(10)); } String msg = s_stringMgr.getString("IndexInfoTab.err.noindex", doi.getSimpleName()); throw new DataSetException(msg); } finally { rs.close(); } } catch (SQLException ex) { throw new DataSetException(ex); } } } --- NEW FILE: BasePreparedStatementTab.java --- package org.firebirdsql.squirrel.tab; import java.awt.Component; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; import java.util.Map; import net.sourceforge.squirrel_sql.fw.datasetviewer.ColumnDisplayDefinition; import net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetException; import net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetScrollingPanel; import net.sourceforge.squirrel_sql.fw.datasetviewer.IDataSet; import net.sourceforge.squirrel_sql.fw.datasetviewer.MapDataSet; import net.sourceforge.squirrel_sql.fw.datasetviewer.ResultSetDataSet; import net.sourceforge.squirrel_sql.fw.util.log.ILogger; import net.sourceforge.squirrel_sql.fw.util.log.LoggerController; import net.sourceforge.squirrel_sql.client.session.ISession; import net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.BaseObjectTab; import net.sourceforge.squirrel_sql.client.session.properties.SessionProperties; public abstract class BasePreparedStatementTab extends BaseObjectTab { /** Title to display for tab. */ private final String _title; /** Hint to display for tab. */ private final String _hint; private boolean _firstRowOnly; /** Component to display in tab. */ private DataSetScrollingPanel _comp; /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(BasePreparedStatementTab.class); public BasePreparedStatementTab(String title, String hint) { this(title, hint, false); } public BasePreparedStatementTab(String title, String hint, boolean firstRowOnly) { super(); if (title == null) { throw new IllegalArgumentException("Title == null"); } _title = title; _hint = hint != null ? hint : title; _firstRowOnly = firstRowOnly; } /** * Return the title for the tab. * * @return The title for the tab. */ public String getTitle() { return _title; } /** * Return the hint for the tab. * * @return The hint for the tab. */ public String getHint() { return _hint; } public void clear() { } public Component getComponent() { if (_comp == null) { _comp = new DataSetScrollingPanel(); } return _comp; } protected void refreshComponent() throws DataSetException { ISession session = getSession(); if (session == null) { throw new IllegalStateException("Null ISession"); } try { PreparedStatement pstmt = createStatement(); try { ResultSet rs = pstmt.executeQuery(); try { final SessionProperties props = session.getProperties(); final String destClassName = props.getMetaDataOutputClassName(); // final LargeResultSetObjectInfo rsoi = props.getLargeResultSetObjectInfo(); // final IDataSet ds = createDataSetFromResultSet(rs, rsoi); final IDataSet ds = createDataSetFromResultSet(rs); _comp.load(ds, destClassName); } finally { rs.close(); } } finally { pstmt.close(); } } catch (SQLException ex) { throw new DataSetException(ex); } } protected abstract PreparedStatement createStatement() throws SQLException; protected IDataSet createDataSetFromResultSet(ResultSet rs) throws DataSetException { final ResultSetDataSet rsds = new ResultSetDataSet(); rsds.setResultSet(rs); if (!_firstRowOnly) { return rsds; } final int columnCount = rsds.getColumnCount(); final ColumnDisplayDefinition[] colDefs = rsds.getDataSetDefinition().getColumnDefinitions(); final Map data = new HashMap(); if (rsds.next(null)) { for (int i = 0; i < columnCount; ++i) { data.put(colDefs[i].getLabel(), rsds.get(i)); } } return new MapDataSet(data); } } --- NEW FILE: GeneratorDetailsTab.java --- package org.firebirdsql.squirrel.tab; /* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ import java.sql.PreparedStatement; import java.sql.SQLException; import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo; import net.sourceforge.squirrel_sql.fw.util.log.ILogger; import net.sourceforge.squirrel_sql.fw.util.log.LoggerController; import net.sourceforge.squirrel_sql.client.session.ISession; /** * This class will display the details for an Oracle sequence. * * @author <A HREF="mailto:co...@us...">Colin Bell</A> */ public class GeneratorDetailsTab extends BasePreparedStatementTab { /** * This interface defines locale specific strings. This should be * replaced with a property file. */ private interface i18n { String TITLE = "Details"; String HINT = "Display sequence details"; } /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(GeneratorDetailsTab.class); public GeneratorDetailsTab() { super(i18n.TITLE, i18n.HINT, true); } protected PreparedStatement createStatement() throws SQLException { ISession session = getSession(); IDatabaseObjectInfo doi = getDatabaseObjectInfo(); String sql = "SELECT CAST('" + doi.getSimpleName() + "' AS VARCHAR(31)) as generator_name, " + "gen_id(" + doi.getSimpleName() + ", 0) as current_value " + "from rdb$database"; PreparedStatement pstmt = session.getSQLConnection().prepareStatement(sql); return pstmt; } } --- NEW FILE: TriggerSourceTab.java --- package org.firebirdsql.squirrel.tab; /* * Copyright (C) 2002 Colin Bell * co...@us... * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ import java.sql.PreparedStatement; import java.sql.SQLException; import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo; import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; import net.sourceforge.squirrel_sql.fw.util.log.ILogger; import net.sourceforge.squirrel_sql.fw.util.log.LoggerController; import net.sourceforge.squirrel_sql.client.session.ISession; /** * This class will display the source for an Oracle trigger. * * @author <A HREF="mailto:co...@us...">Colin Bell</A> */ public class TriggerSourceTab extends BaseSourceTab { /** SQL that retrieves the source of a stored procedure. */ private static String SQL = "select rdb$trigger_source from rdb$triggers" + " where rdb$trigger_name = ?"; /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(TriggerSourceTab.class); public TriggerSourceTab(String hint) { super(hint); } protected PreparedStatement createStatement() throws SQLException { final ISession session = getSession(); final IDatabaseObjectInfo doi = getDatabaseObjectInfo(); SQLConnection conn = session.getSQLConnection(); PreparedStatement pstmt = conn.prepareStatement(SQL); pstmt.setString(1, doi.getSimpleName()); return pstmt; } } |