==============================================================================
Frequently Asked Questions file for the SwingSet Open Toolkit for Java Swing.
==============================================================================

$Id: FAQ.txt,v 1.7 2004/02/23 21:19:34 prasanth Exp $


==============================================================================
FAQ
==============================================================================

1.  I am trying to run the samples. I see "Processing....." and nothing
    happens.  What is wrong?

    You might be missing one or more required jar files.  Please make sure
    that you have the following jar files:
        1.swingSet.jar
        2.rowset.jar (Available from:
          http://developer.java.sun.com/developer/earlyAccess/jdbc/jdbc-rowset.html)
        3.pg73jdbc3.jar (Driver for remote PostgreSQL database.  Available
          from: http://jdbc.postgresql.org/download/pg73jdbc3.jar)

    If you still have problems:
        1. Unzip the jar file and extract the files to a folder.
        2. From a command prompt go to that folder and type:
            java  MainClass
        3. You will now see any remaining errors on the command prompt screen.
        

2.  I have set the headers for a SSDataGrid, so why I don't see them on the
    screen?

    You have to set the headers before you set the rowset. If you reverse the
    order, you will not see the headers.  If you want to specify headers, use
    the empty constructor.


3.  Why am I getting an exception, while setting the renderers.

    You have to set the renderer only after you have set the rowset.  Until
    you set the rowset the JTable does not have any columns, so when you try
    to set a renderer SSDataGrid tries to access the specified column from
    JTable, which causes an exception.
        

4.  What happens to my default values and any other custom settings when I
    change my underlying rowset?

    All the defaults and other information like headers, renderer will remain
    the same even after changing the rowset for a SSDataGrid. If you want to
    change any settings or remove the defaults and/or headers, you have to
    call the setXXXXX() functions to change the behavior.
    
    Example: You have a rowset for a SSDataGrid and have set the default value
             for the third column to be "XYZ". If you then change the query
             for the rowset and want to remove the defaults for the SSDataGrid,
             you have to call the setDefaultValues() method like this:
                 dataGrid.setDefaultValues(null,null);
                 
             This will remove all the default values used.
        
5.  I setup a SSDataGrid based on a rowset querying columns "X," "Y," and "Z."
    I made a small change to the underlying query but return the same set of 
    columns.  Why are my renderers and/or hidden columns not working as
    expected?
    
    When modifying a query for a SSDataGrid's rowset, you must insure that the 
    columns are returned in the same order!  When you set a renderer, or
    specify a column as hidden you specify either a column number or column
    name (in which case SwingSet internally converts the name to a column 
    number).  If you change the column ordering for the underlying query and 
    apply the modified rowset to your SSDataGrid, SwingSet continues to use
    the "old" column numbers for any renderers or hidden columns.  You will
    have to supply new renderers/hidden columns for the reordered columns.
    
    
6. I'm having trouble getting SwingSet to work with MySQL.  Are there any special
   instructions?

    Yes.  The mysql-connector-java MySQL driver has a unique ResultSet implementation.
    The default ResultSet is not updatable so an UpdatableResultSet is needed for
    creating updatable GUI's with SwingSet.  Rather than creating a RowSet using a
    connection string and query, the developer should instantiate their RowSet with an
    UpdatableResultSet.  
    
    In addition, since there is no connection  string or query, the SSDataNavigator
    needs to be explicitly told not to call the execute() method of RowSet and to
    assume that the RowSet already contains the query results.  This is done with the
    setCallExecute() method.
    
    Example:
        Let rs be your UpdatableResultSet object.
        JdbcRowSetImpl rowset = new JdbcRowSetImpl(rs);
        SSDataNavigator dataNavigator = new SSDataNavigator();
        dataNavigator.setCallExecute(false);
        dataNavigator.setRowSet(rowset);
        
        If you want to change the query, change the rs object as needed, re-instantiate
        your RowSet, and re-call the setRowSet method of your SSDataNavigator.

    (P.S.: This is a work around provided for MySQL DB users based on the feedback from lopes.
     see http://sourceforge.net/forum/forum.php?thread_id=1005899&forum_id=313186)