001 /* JAPI - (Yet another (hopefully) useful) Java API 002 * 003 * Copyright (C) 2004-2006 Christian Hujer 004 * 005 * This program is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU General Public License as 007 * published by the Free Software Foundation; either version 2 of the 008 * License, or (at your option) any later version. 009 * 010 * This program is distributed in the hope that it will be useful, but 011 * WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * General Public License for more details. 014 * 015 * You should have received a copy of the GNU General Public License 016 * along with this program; if not, write to the Free Software 017 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 018 * 02111-1307, USA. 019 */ 020 021 package net.sf.japi.sql; 022 023 import java.sql.ResultSet; 024 import java.sql.SQLException; 025 import javax.swing.table.TableModel; 026 import net.sf.japi.util.ThrowableHandler; 027 028 /** Interface for TableModels which handle information from ResultSets. 029 * @author <a href="mailto:chris@riedquat.de">Christian Hujer</a> 030 */ 031 public interface ResultSetTableModel extends TableModel { 032 033 /** Set the ResultSet. 034 * @param resultSet ResultSet, maybe <code>null</code> 035 */ 036 void setResultSet(ResultSet resultSet); 037 038 /** Get the ResultSet. 039 * @return ResultSet or <code>null</code> if there is no current result set 040 */ 041 ResultSet getResultSet(); 042 043 /** Adds a ThrowableHandler to this model. 044 * @param throwableHandler ThrowableHandler to add 045 */ 046 void addThrowableHandler(ThrowableHandler<? super SQLException> throwableHandler); 047 048 /** Removes a ThrowableHandler from this model. 049 * @param throwableHandler ThrowableHandler to add 050 */ 051 void removeThrowableHandler(ThrowableHandler<? super SQLException> throwableHandler); 052 053 } // interface ResultSetTableModel