[Squirrel-sql-commits] sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttre
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
From: Rob M. <man...@us...> - 2005-11-27 02:19:04
|
Update of /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18701/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table Modified Files: ColumnPriviligesTab.java ColumnsTab.java ContentsTab.java ExportedKeysTab.java ImportedKeysTab.java IndexesTab.java PrimaryKeyTab.java TablePriviligesTab.java VersionColumnsTab.java Log Message: 1276957: use new methods in SQLDMD that encapsulate access to ResultSets instead of returning them. Index: ExportedKeysTab.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/ExportedKeysTab.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ExportedKeysTab.java 19 May 2004 15:22:55 -0000 1.6 --- ExportedKeysTab.java 27 Nov 2005 02:18:53 -0000 1.7 *************** *** 1,91 **** ! package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table; ! /* ! * Copyright (C) 2001-2003 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.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.ResultSetDataSet; ! import net.sourceforge.squirrel_sql.fw.sql.ITableInfo; ! import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; ! /** ! * This tab shows the columns in the currently selected table. ! * ! * @author <A HREF="mailto:co...@us...">Colin Bell</A> ! */ ! public class ExportedKeysTab extends BaseTableTab ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! private interface i18n ! { ! String TITLE = "Exported Keys"; ! String HINT = "Show tables that reference this table"; ! } ! ! /** ! * 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 i18n.HINT; ! } ! ! /** ! * Create the <TT>IDataSet</TT> to be displayed in this tab. ! */ ! protected IDataSet createDataSet() throws DataSetException ! { ! final SQLConnection conn = getSession().getSQLConnection(); ! try ! { ! final ITableInfo ti = getTableInfo(); ! final ResultSet rs = conn.getSQLMetaData().getExportedKeys(ti); ! try ! { ! final ResultSetDataSet rsds = new ResultSetDataSet(); ! rsds.setResultSet(rs, null, true); ! return rsds; ! } ! finally ! { ! rs.close(); ! } ! } ! catch (SQLException ex) ! { ! throw new DataSetException(ex); ! } ! } ! } --- 1,68 ---- ! package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table; ! /* ! * Copyright (C) 2001-2003 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 net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetException; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.IDataSet; ! import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; ! /** ! * This tab shows the columns in the currently selected table. ! * ! * @author <A HREF="mailto:co...@us...">Colin Bell</A> ! */ ! public class ExportedKeysTab extends BaseTableTab ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! private interface i18n ! { ! String TITLE = "Exported Keys"; ! String HINT = "Show tables that reference this table"; ! } ! ! /** ! * 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 i18n.HINT; ! } ! ! /** ! * Create the <TT>IDataSet</TT> to be displayed in this tab. ! */ ! protected IDataSet createDataSet() throws DataSetException ! { ! final SQLConnection conn = getSession().getSQLConnection(); ! return conn.getSQLMetaData().getExportedKeysDataSet(getTableInfo()); ! } ! } Index: PrimaryKeyTab.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/PrimaryKeyTab.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PrimaryKeyTab.java 19 May 2004 14:24:09 -0000 1.3 --- PrimaryKeyTab.java 27 Nov 2005 02:18:53 -0000 1.4 *************** *** 1,89 **** ! package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table; ! /* ! * Copyright (C) 2001-2003 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.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.ResultSetDataSet; ! import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; ! /** ! * This tab shows the primary key info for the currently selected table. ! * ! * @author <A HREF="mailto:co...@us...">Colin Bell</A> ! */ ! public class PrimaryKeyTab extends BaseTableTab ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! private interface i18n ! { ! String TITLE = "Primary Key"; ! String HINT = "Show primary key for table"; ! } ! ! /** ! * 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 i18n.HINT; ! } ! ! /** ! * Create the <TT>IDataSet</TT> to be displayed in this tab. ! */ ! protected IDataSet createDataSet() throws DataSetException ! { ! final SQLConnection conn = getSession().getSQLConnection(); ! try ! { ! final ResultSet rs = conn.getSQLMetaData().getPrimaryKeys(getTableInfo()); ! try ! { ! final ResultSetDataSet rsds = new ResultSetDataSet(); ! rsds.setResultSet(rs, new int[] { 6, 5, 4 }, true); ! return rsds; ! } ! finally ! { ! rs.close(); ! } ! } ! catch (SQLException ex) ! { ! throw new DataSetException(ex); ! } ! } ! } --- 1,78 ---- ! package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table; ! /* ! * Copyright (C) 2001-2003 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.SQLException; ! ! import net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetException; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.IDataSet; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.ObjectArrayDataSet; ! import net.sourceforge.squirrel_sql.fw.sql.PrimaryKeyInfo; ! import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; ! import net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData; ! /** ! * This tab shows the primary key info for the currently selected table. ! * ! * @author <A HREF="mailto:co...@us...">Colin Bell</A> ! */ ! public class PrimaryKeyTab extends BaseTableTab ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! private interface i18n ! { ! String TITLE = "Primary Key"; ! String HINT = "Show primary key for table"; ! } ! ! /** ! * 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 i18n.HINT; ! } ! ! /** ! * Create the <TT>IDataSet</TT> to be displayed in this tab. ! */ ! protected IDataSet createDataSet() throws DataSetException ! { ! final SQLConnection conn = getSession().getSQLConnection(); ! IDataSet result = null; ! SQLDatabaseMetaData md = conn.getSQLMetaData(); ! result = md.getPrimaryKey(getTableInfo(), ! new int[] { 6, 5, 4 }, ! true); ! return result; ! } ! } Index: ColumnsTab.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/ColumnsTab.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ColumnsTab.java 16 Nov 2005 10:58:04 -0000 1.6 --- ColumnsTab.java 27 Nov 2005 02:18:53 -0000 1.7 *************** *** 18,28 **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - 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.ResultSetDataSet; import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; /** * This tab shows the columns in the currently selected table. --- 18,25 ---- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ import net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetException; import net.sourceforge.squirrel_sql.fw.datasetviewer.IDataSet; import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; + import net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData; /** * This tab shows the columns in the currently selected table. *************** *** 32,35 **** --- 29,35 ---- public class ColumnsTab extends BaseTableTab { + private static int[] columnIndices = + new int[] { 4, 6, 7, 9, 18, 13, 12, 5, 8, 10, 11, 14, 15, 16, 17 }; + /** * This interface defines locale specific strings. This should be *************** *** 68,89 **** { final SQLConnection conn = getSession().getSQLConnection(); ! try ! { ! final ResultSet rs = conn.getSQLMetaData().getColumns(getTableInfo()); ! try ! { ! final ResultSetDataSet rsds = new ResultSetDataSet(); ! rsds.setResultSet(rs, new int[] { 4, 6, 7, 9, 18, 13, 12, 5, 8, 10, 11, 14, 15, 16, 17 }, true); ! return rsds; ! } ! finally ! { ! rs.close(); ! } ! } ! catch (SQLException ex) ! { ! throw new DataSetException(ex); ! } } } --- 68,73 ---- { final SQLConnection conn = getSession().getSQLConnection(); ! SQLDatabaseMetaData md = conn.getSQLMetaData(); ! return md.getColumns(getTableInfo(), columnIndices, true); } } Index: TablePriviligesTab.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/TablePriviligesTab.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TablePriviligesTab.java 19 May 2004 14:25:06 -0000 1.3 --- TablePriviligesTab.java 27 Nov 2005 02:18:53 -0000 1.4 *************** *** 1,89 **** ! package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table; ! /* ! * Copyright (C) 2001-2003 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.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.ResultSetDataSet; ! import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; ! /** ! * This tab shows the table privilege info for the currently selected table. ! * ! * @author <A HREF="mailto:co...@us...">Colin Bell</A> ! */ ! public class TablePriviligesTab extends BaseTableTab ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! private interface i18n ! { ! String TITLE = "Privileges"; ! String HINT = "Show access rights for table"; ! } ! ! /** ! * 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 i18n.HINT; ! } ! ! /** ! * Create the <TT>IDataSet</TT> to be displayed in this tab. ! */ ! protected IDataSet createDataSet() throws DataSetException ! { ! final SQLConnection conn = getSession().getSQLConnection(); ! try ! { ! final ResultSet rs = conn.getSQLMetaData().getTablePrivileges(getTableInfo()); ! try ! { ! final ResultSetDataSet rsds = new ResultSetDataSet(); ! rsds.setResultSet(rs, new int[] { 5, 6, 7, 4 }, true); ! return rsds; ! } ! finally ! { ! rs.close(); ! } ! } ! catch (SQLException ex) ! { ! throw new DataSetException(ex); ! } ! } ! } --- 1,73 ---- ! package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table; ! /* ! * Copyright (C) 2001-2003 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 net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetException; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.IDataSet; ! import net.sourceforge.squirrel_sql.fw.sql.ITableInfo; ! import net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData; ! /** ! * This tab shows the table privilege info for the currently selected table. ! * ! * @author <A HREF="mailto:co...@us...">Colin Bell</A> ! */ ! public class TablePriviligesTab extends BaseTableTab ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! private interface i18n ! { ! String TITLE = "Privileges"; ! String HINT = "Show access rights for table"; ! } ! ! private int[] columnIndices = new int[] { 5, 6, 7, 4 }; ! ! /** ! * 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 i18n.HINT; ! } ! ! /** ! * Create the <TT>IDataSet</TT> to be displayed in this tab. ! */ ! protected IDataSet createDataSet() throws DataSetException ! { ! final SQLDatabaseMetaData md = ! getSession().getSQLConnection().getSQLMetaData(); ! ITableInfo ti = getTableInfo(); ! return md.getTablePrivilegesDataSet(ti, columnIndices, true); ! } ! } Index: ContentsTab.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/ContentsTab.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** ContentsTab.java 27 Jul 2005 20:28:41 -0000 1.46 --- ContentsTab.java 27 Nov 2005 02:18:53 -0000 1.47 *************** *** 23,54 **** import java.awt.event.MouseListener; import java.sql.DatabaseMetaData; - import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; - import java.util.HashMap; - import java.util.Vector; - - import javax.swing.JOptionPane; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.*; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.CellComponentFactory; import net.sourceforge.squirrel_sql.fw.gui.TablePopupMenu; import net.sourceforge.squirrel_sql.fw.sql.ITableInfo; import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; import net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData; ! import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo; import net.sourceforge.squirrel_sql.fw.sql.dbobj.BestRowIdentifier; 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.DataSetUpdateableTableModelImpl; - import net.sourceforge.squirrel_sql.client.session.properties.EditWhereCols; - import net.sourceforge.squirrel_sql.client.session.properties.SessionProperties; - import net.sourceforge.squirrel_sql.client.session.sqlfilter.OrderByClausePanel; - import net.sourceforge.squirrel_sql.client.session.sqlfilter.SQLFilterClauses; - import net.sourceforge.squirrel_sql.client.session.sqlfilter.WhereClausePanel; - /** * This is the tab showing the contents (data) of the table. --- 23,54 ---- import java.awt.event.MouseListener; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; ! import net.sourceforge.squirrel_sql.client.session.DataSetUpdateableTableModelImpl; ! import net.sourceforge.squirrel_sql.client.session.ISession; ! import net.sourceforge.squirrel_sql.client.session.properties.SessionProperties; ! import net.sourceforge.squirrel_sql.client.session.sqlfilter.OrderByClausePanel; ! import net.sourceforge.squirrel_sql.client.session.sqlfilter.SQLFilterClauses; ! import net.sourceforge.squirrel_sql.client.session.sqlfilter.WhereClausePanel; ! 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.DataSetUpdateableTableModelListener; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetViewerTablePanel; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.IDataSet; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.IDataSetUpdateableTableModel; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.ResultSetDataSet; import net.sourceforge.squirrel_sql.fw.gui.TablePopupMenu; + import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo; import net.sourceforge.squirrel_sql.fw.sql.ITableInfo; import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; import net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData; ! import net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo; import net.sourceforge.squirrel_sql.fw.sql.dbobj.BestRowIdentifier; import net.sourceforge.squirrel_sql.fw.util.log.ILogger; import net.sourceforge.squirrel_sql.fw.util.log.LoggerController; /** * This is the tab showing the contents (data) of the table. *************** *** 176,180 **** final ISession session = getSession(); final SQLConnection conn = session.getSQLConnection(); ! final SQLDatabaseMetaData md = conn.getSQLMetaData(); // final SQLFilterClauses sqlFilterClauses = session.getSQLFilterClauses(); --- 176,182 ---- final ISession session = getSession(); final SQLConnection conn = session.getSQLConnection(); ! SQLDatabaseMetaData md = conn.getSQLMetaData(); ! //ISQLDatabaseMetaData md = conn.getSQLMetaData(); ! //md = (ISQLDatabaseMetaData)Spin.off(md); // final SQLFilterClauses sqlFilterClauses = session.getSQLFilterClauses(); *************** *** 247,251 **** catch (Throwable th) { ! s_log.debug("getBestRowIdentifier not supported", th); } --- 249,254 ---- catch (Throwable th) { ! s_log.debug("getBestRowIdentifier not supported for table "+ ! currentTableName, th); } *************** *** 351,355 **** // the same table/DB on different machines is treated differently. rsds.setContentsTabResultSet(rs, _dataSetUpdateableTableModel.getFullTableName()); ! // KLUDGE: // We want some info about the columns to be available for validating the --- 354,360 ---- // the same table/DB on different machines is treated differently. rsds.setContentsTabResultSet(rs, _dataSetUpdateableTableModel.getFullTableName()); ! if (rs != null) { ! try { rs.close(); } catch (SQLException e) {} ! } // KLUDGE: // We want some info about the columns to be available for validating the *************** *** 367,389 **** // we collect the collumn nullability information from getColumns() and pass that // info to the ResultSet to override what it got from the ResultSetMetaData. ! final ResultSet columnRS = md.getColumns(getTableInfo()); ! try ! { ! final ColumnDisplayDefinition[] colDefs = rsds.getDataSetDefinition().getColumnDefinitions(); ! // get the nullability information and pass it into the ResultSet ! // Unfortunately, not all DBMSs provide the column number in object 17 as stated in the ! // SQL documentation, so we have to guess that the result set is in column order ! int columnNumber = 0; ! while (columnRS.next()) { ! boolean isNullable = true; ! if (columnRS.getInt(11) == DatabaseMetaData.columnNoNulls) ! isNullable = false; ! colDefs[columnNumber++].setIsNullable(isNullable); ! } ! } ! finally ! { ! columnRS.close(); } --- 372,389 ---- // we collect the collumn nullability information from getColumns() and pass that // info to the ResultSet to override what it got from the ResultSetMetaData. ! TableColumnInfo[] columnInfos = md.getColumnInfo(getTableInfo()); ! final ColumnDisplayDefinition[] colDefs = ! rsds.getDataSetDefinition().getColumnDefinitions(); ! // get the nullability information and pass it into the ResultSet ! // Unfortunately, not all DBMSs provide the column number in object 17 as stated in the ! // SQL documentation, so we have to guess that the result set is in column order ! for (int i = 0; i < columnInfos.length; i++) { ! boolean isNullable = true; ! TableColumnInfo info = columnInfos[i]; ! if (info.isNullAllowed() == DatabaseMetaData.columnNoNulls) { ! isNullable = false; ! } ! colDefs[i].setIsNullable(isNullable); } Index: IndexesTab.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/IndexesTab.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IndexesTab.java 19 May 2004 14:23:40 -0000 1.3 --- IndexesTab.java 27 Nov 2005 02:18:53 -0000 1.4 *************** *** 1,89 **** ! package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table; ! /* ! * Copyright (C) 2001-2003 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.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.ResultSetDataSet; ! import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; ! /** ! * This tab shows the columns in the currently selected table. ! * ! * @author <A HREF="mailto:co...@us...">Colin Bell</A> ! */ ! public class IndexesTab extends BaseTableTab ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! private interface i18n ! { ! String TITLE = "Indexes"; ! String HINT = "Show indexes"; ! } ! ! /** ! * 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 i18n.HINT; ! } ! ! /** ! * Create the <TT>IDataSet</TT> to be displayed in this tab. ! */ ! protected IDataSet createDataSet() throws DataSetException ! { ! final SQLConnection conn = getSession().getSQLConnection(); ! try ! { ! final ResultSet rs = conn.getSQLMetaData().getIndexInfo(getTableInfo()); ! try ! { ! final ResultSetDataSet rsds = new ResultSetDataSet(); ! rsds.setResultSet(rs, new int[] {5, 6, 8, 9, 10, 4, 7, 11, 12, 13 }, true); ! return rsds; ! } ! finally ! { ! rs.close(); ! } ! } ! catch (SQLException ex) ! { ! throw new DataSetException(ex); ! } ! } ! } --- 1,87 ---- ! package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table; ! /* ! * Copyright (C) 2001-2003 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 net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetException; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.IDataSet; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.ResultSetDataSet; ! import net.sourceforge.squirrel_sql.fw.sql.ITableInfo; ! import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; ! import net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData; ! /** ! * This tab shows the columns in the currently selected table. ! * ! * @author <A HREF="mailto:co...@us...">Colin Bell</A> ! */ ! public class IndexesTab extends BaseTableTab ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! private interface i18n ! { ! String TITLE = "Indexes"; ! String HINT = "Show indexes"; ! } ! ! private static final int[] indexIndices = ! new int[] {5, 6, 8, 9, 10, 4, 7, 11, 12, 13 }; ! ! /** ! * 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 i18n.HINT; ! } ! ! /** ! * Create the <TT>IDataSet</TT> to be displayed in this tab. ! */ ! protected IDataSet createDataSet() throws DataSetException ! { ! final SQLConnection conn = getSession().getSQLConnection(); ! final SQLDatabaseMetaData dmd = conn.getSQLMetaData(); ! ITableInfo ti = getTableInfo(); ! if (! "TABLE".equalsIgnoreCase(ti.getType())) { ! return null; ! } ! ResultSetDataSet rsds = ! dmd.getIndexInfo(getTableInfo(), indexIndices, true); ! rsds.next(null); ! String indexName = (String)rsds.get(1); ! if (indexName == null) { ! rsds.removeRow(0); ! } ! rsds.resetCursor(); ! return rsds; ! } ! } Index: VersionColumnsTab.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/VersionColumnsTab.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** VersionColumnsTab.java 19 May 2004 14:25:24 -0000 1.3 --- VersionColumnsTab.java 27 Nov 2005 02:18:53 -0000 1.4 *************** *** 1,89 **** ! package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table; ! /* ! * Copyright (C) 2001-2003 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.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.ResultSetDataSet; ! import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; ! /** ! * This tab shows the version info for the currently selected table. ! * ! * @author <A HREF="mailto:co...@us...">Colin Bell</A> ! */ ! public class VersionColumnsTab extends BaseTableTab ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! private interface i18n ! { ! String TITLE = "Versions"; ! String HINT = "Show columns that are automatically updated when row updated"; ! } ! ! /** ! * 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 i18n.HINT; ! } ! ! /** ! * Create the <TT>IDataSet</TT> to be displayed in this tab. ! */ ! protected IDataSet createDataSet() throws DataSetException ! { ! final SQLConnection conn = getSession().getSQLConnection(); ! try ! { ! final ResultSet rs = conn.getSQLMetaData().getVersionColumns(getTableInfo()); ! try ! { ! final ResultSetDataSet rsds = new ResultSetDataSet(); ! rsds.setResultSet(rs); ! return rsds; ! } ! finally ! { ! rs.close(); ! } ! } ! catch (SQLException ex) ! { ! throw new DataSetException(ex); ! } ! } ! } --- 1,69 ---- ! package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table; ! /* ! * Copyright (C) 2001-2003 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 net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetException; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.IDataSet; ! import net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData; ! /** ! * This tab shows the version info for the currently selected table. ! * ! * @author <A HREF="mailto:co...@us...">Colin Bell</A> ! */ ! public class VersionColumnsTab extends BaseTableTab ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! private interface i18n ! { ! String TITLE = "Versions"; ! String HINT = "Show columns that are automatically updated when row updated"; ! } ! ! /** ! * 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 i18n.HINT; ! } ! ! /** ! * Create the <TT>IDataSet</TT> to be displayed in this tab. ! */ ! protected IDataSet createDataSet() throws DataSetException ! { ! final SQLDatabaseMetaData md = ! getSession().getSQLConnection().getSQLMetaData(); ! return md.getVersionColumnsDataSet(getTableInfo()); ! } ! } Index: ColumnPriviligesTab.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/ColumnPriviligesTab.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ColumnPriviligesTab.java 19 May 2004 14:21:24 -0000 1.3 --- ColumnPriviligesTab.java 27 Nov 2005 02:18:53 -0000 1.4 *************** *** 1,89 **** ! package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table; ! /* ! * Copyright (C) 2001-2003 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.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.ResultSetDataSet; ! import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; ! /** ! * This tab shows the column privilege info for the currently selected table. ! * ! * @author <A HREF="mailto:co...@us...">Colin Bell</A> ! */ ! public class ColumnPriviligesTab extends BaseTableTab ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! private interface i18n ! { ! String TITLE = "Column Privileges"; ! String HINT = "Show access rights for columns"; ! } ! ! /** ! * 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 i18n.HINT; ! } ! ! /** ! * Create the <TT>IDataSet</TT> to be displayed in this tab. ! */ ! protected IDataSet createDataSet() throws DataSetException ! { ! final SQLConnection conn = getSession().getSQLConnection(); ! try ! { ! final ResultSet rs = conn.getSQLMetaData().getColumnPrivileges(getTableInfo()); ! try ! { ! final ResultSetDataSet rsds = new ResultSetDataSet(); ! rsds.setResultSet(rs, new int[] { 4, 6, 7, 5, 8 }, true ); ! return rsds; ! } ! finally ! { ! rs.close(); ! } ! } ! catch (SQLException ex) ! { ! throw new DataSetException(ex); ! } ! } ! } --- 1,73 ---- ! package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table; ! /* ! * Copyright (C) 2001-2003 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 net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetException; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.IDataSet; ! import net.sourceforge.squirrel_sql.fw.sql.ITableInfo; ! import net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData; ! /** ! * This tab shows the column privilege info for the currently selected table. ! * ! * @author <A HREF="mailto:co...@us...">Colin Bell</A> ! */ ! public class ColumnPriviligesTab extends BaseTableTab ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! private interface i18n ! { ! String TITLE = "Column Privileges"; ! String HINT = "Show access rights for columns"; ! } ! ! private int[] columnIndices = new int[] { 4, 6, 7, 5, 8 }; ! ! /** ! * 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 i18n.HINT; ! } ! ! /** ! * Create the <TT>IDataSet</TT> to be displayed in this tab. ! */ ! protected IDataSet createDataSet() throws DataSetException ! { ! final SQLDatabaseMetaData md = ! getSession().getSQLConnection().getSQLMetaData(); ! final ITableInfo ti = getTableInfo(); ! return md.getColumnPrivilegesDataSet(ti,columnIndices, true); ! } ! } Index: ImportedKeysTab.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/ImportedKeysTab.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ImportedKeysTab.java 19 May 2004 15:23:08 -0000 1.7 --- ImportedKeysTab.java 27 Nov 2005 02:18:53 -0000 1.8 *************** *** 1,93 **** ! package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table; ! /* ! * Copyright (C) 2001-2003 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.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.ResultSetDataSet; ! import net.sourceforge.squirrel_sql.fw.sql.ITableInfo; ! import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; ! /** ! * This tab shows the imported keys in the currently selected table. ! * ! * @author <A HREF="mailto:co...@us...">Colin Bell</A> ! */ ! public class ImportedKeysTab extends BaseTableTab ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! private interface i18n ! { ! String TITLE = "Imported Keys"; ! String HINT = "Show tables that this table references"; ! } ! ! /** ! * 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 i18n.HINT; ! } ! ! /** ! * Retrieve the <TT>IDataSet</TT> to be displayed in this tab. ! * ! * @return the <TT>IDataSet</TT> to be displayed in this tab. ! */ ! protected IDataSet createDataSet() throws DataSetException ! { ! final SQLConnection conn = getSession().getSQLConnection(); ! try ! { ! final ITableInfo ti = getTableInfo(); ! final ResultSet rs = conn.getSQLMetaData().getImportedKeys(ti); ! try ! { ! final ResultSetDataSet rsds = new ResultSetDataSet(); ! rsds.setResultSet(rs, null, true); ! return rsds; ! } ! finally ! { ! rs.close(); ! } ! } ! catch (SQLException ex) ! { ! throw new DataSetException(ex); ! } ! } ! } --- 1,70 ---- ! package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table; ! /* ! * Copyright (C) 2001-2003 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 net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetException; ! import net.sourceforge.squirrel_sql.fw.datasetviewer.IDataSet; ! import net.sourceforge.squirrel_sql.fw.sql.SQLConnection; ! /** ! * This tab shows the imported keys in the currently selected table. ! * ! * @author <A HREF="mailto:co...@us...">Colin Bell</A> ! */ ! public class ImportedKeysTab extends BaseTableTab ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! private interface i18n ! { ! String TITLE = "Imported Keys"; ! String HINT = "Show tables that this table references"; ! } ! ! /** ! * 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 i18n.HINT; ! } ! ! /** ! * Retrieve the <TT>IDataSet</TT> to be displayed in this tab. ! * ! * @return the <TT>IDataSet</TT> to be displayed in this tab. ! */ ! protected IDataSet createDataSet() throws DataSetException ! { ! final SQLConnection conn = getSession().getSQLConnection(); ! return conn.getSQLMetaData().getImportedKeysDataSet(getTableInfo()); ! } ! } |