/**
* Shutdown the application
- * @throws java.sql.SQLException If an SQL error occurs
* @throws java.io.IOException If an IO error occurs
+ * @throws java.sql.SQLException If a SQL error occurs
*/
- public void doShutdown () throws SQLException, IOException;
+ public void doShutdown () throws IOException, SQLException;
}
/**
* Shuts down the client and therefore whole application
- * @throws java.sql.SQLException If an SQL error occurs
* @throws java.io.IOException If an IO error occurs
+ * @throws java.sql.SQLException If a SQL error occurs
*/
- public void doShutdown () throws SQLException, IOException;
+ public void doShutdown () throws IOException, SQLException;
/**
* Displays a message to the user
*/
package org.mxchange.jcore.client.gui;
+import java.io.IOException;
import org.mxchange.jcore.FrameworkInterface;
import org.mxchange.jcore.client.Client;
import org.mxchange.jcore.contact.Contact;
+import org.mxchange.jcore.exceptions.BadTokenException;
import org.mxchange.jcore.exceptions.FrameAlreadyInitializedException;
/**
* call this method.
*
* @param client Client instance
+ * @throws java.io.IOException If an IO error was found
+ * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found
*/
- public void setupFrame (final Client client);
+ public void setupFrame (final Client client) throws IOException, BadTokenException;
/**
* Initializes frame
package org.mxchange.jcore.database.frontend;
import java.lang.reflect.InvocationTargetException;
+import java.sql.ResultSet;
import java.sql.SQLException;
import org.mxchange.jcore.BaseFrameworkSystem;
import org.mxchange.jcore.database.backend.DatabaseBackend;
+import org.mxchange.jcore.database.result.DatabaseResult;
+import org.mxchange.jcore.database.result.Result;
+import org.mxchange.jcore.database.storage.Storeable;
import org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException;
import org.mxchange.jcore.factory.database.backend.BackendFactory;
// Trace message
this.getLogger().trace("EXIT!"); //NOI18N
}
+
+ /**
+ * Gets a Result back from given ResultSet instance
+ *
+ * @param resultSet ResultSet instance from SQL driver
+ * @return A typorized Result instance
+ * @throws java.sql.SQLException If an SQL error occurs
+ */
+ @Override
+ public Result<? extends Storeable> getResultFromSet (final ResultSet resultSet) throws SQLException {
+ // Init result instance
+ Result<? extends Storeable> result = new DatabaseResult();
+
+ // Attach all possible warnings
+ result.setWarnings(resultSet.getWarnings());
+
+ // And return it
+ return result;
+ }
}
*/
package org.mxchange.jcore.database.result;
+import java.sql.SQLWarning;
import java.util.Iterator;
import java.util.SortedSet;
import java.util.TreeSet;
*/
private final SortedSet<Storeable> result;
+ /**
+ * SQLWarning instance
+ */
+ private SQLWarning warnings;
+
/**
* Default constructor
*/
this.result.add(storeable);
}
+ /**
+ * Getter for warnings
+ *
+ * @return SQLQarning from ResultSet instance
+ */
@Override
- public int size () {
- return this.result.size();
+ public SQLWarning getWarnings () {
+ return this.warnings;
+ }
+
+ /**
+ * Setter for warnings
+ *
+ * @param warnings SQLQarning from ResultSet instance
+ */
+ @Override
+ public void setWarnings (final SQLWarning warnings) {
+ this.warnings = warnings;
}
@Override
// Call iterator's method
this.iterator().remove();
}
+
+ @Override
+ public int size () {
+ return this.result.size();
+ }
}
*/
package org.mxchange.jcore.database.result;
+import java.sql.SQLWarning;
import java.util.Iterator;
import org.mxchange.jcore.FrameworkInterface;
import org.mxchange.jcore.database.storage.Storeable;
*/
public void add (final Storeable storeable);
+ /**
+ * Setter for warnings
+ *
+ * @param warnings SQLQarning from ResultSet instance
+ */
+ public void setWarnings (final SQLWarning warnings);
+
+ /**
+ * Getter for warnings
+ *
+ * @return SQLQarning from ResultSet instance
+ */
+ public SQLWarning getWarnings ();
+
/**
* Returns size of result
*
/**
* Shuts down this contact manager
- * @throws java.sql.SQLException If any SQL error occurs
- * @throws java.io.IOException If any IO error occurs
+ * @throws java.sql.SQLException If an SQL error occurs
+ * @throws java.io.IOException If an IO error occurs
*/
public void doShutdown () throws SQLException, IOException;
}
*/
package org.mxchange.jcore.manager.database;
+import java.lang.reflect.InvocationTargetException;
import org.mxchange.jcore.manager.Manageable;
/**
* @param rowIndex Row index
* @param columnIndex Column index
* @return Value from given row/column
+ * @throws java.lang.NoSuchMethodException If a non-existing method should be invoked
+ * @throws java.lang.IllegalAccessException If the method cannot be accessed
+ * @throws java.lang.reflect.InvocationTargetException Something other happened?
*/
- public Object getValueFromRowColumn (final int rowIndex, final int columnIndex);
+ public Object getValueFromRowColumn (final int rowIndex, final int columnIndex) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException;
/**
* Getter for column count
*/
package org.mxchange.jcore.model.swing.contact;
+import java.lang.reflect.InvocationTargetException;
import java.text.MessageFormat;
import javax.swing.table.TableModel;
import org.mxchange.jcore.client.Client;
// Get manager
ManageableDatabase manager = (ManageableDatabase) this.getClient().getManager();
- // Deligate this call to contact manager
- return manager.getValueFromRowColumn(rowIndex, columnIndex);
+ // Init value
+ Object value = null;
+
+ try {
+ // Deligate this call to contact manager
+ value = manager.getValueFromRowColumn(rowIndex, columnIndex);
+ } catch (final NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
+ // Abort here
+ this.abortProgramWithException(ex);
+ }
+
+ // Return it
+ return value;
}
@Override