Donate Share

SwingSet

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

getPrimaryColumnValue with mysql

You are viewing a single message from this topic. View all messages.

  1. 2006-06-15 17:02:06 UTC
    This is in the FAQ and might help...

    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)
< Previous | 1 | Next >

Add a Reply

You can use Markdown syntax in your reply.

Preview

Monitor this

Log in to monitor this topic. Not registered? Create an account to receive email updates when replies are posted to this topic. If you do not log in or register, your reply will be added anonymously.