|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.mp3dings.export.DatabaseConnection
net.sourceforge.mp3dings.export.DatabaseExporter
public class DatabaseExporter
Exports data to a JDBC database.
| Field Summary |
|---|
| Fields inherited from class net.sourceforge.mp3dings.export.DatabaseConnection |
|---|
P_CLASSPATH, P_DRIVER, P_FIELD_PREFIX, P_PASSWORD, P_TABLE, P_URL, P_USER, PREF_EXPORT, PREF_IMPORT |
| Constructor Summary | |
|---|---|
DatabaseExporter(Properties config,
ClassLoaderProvider clp)
Establishes a new database connection that can export data from mp3dings to the database. |
|
| Method Summary | |
|---|---|
static Properties |
editConfig(Component parent,
Properties config,
Field[] availableFields,
ClassLoaderProvider clp)
Displays a wizard to interactively create or modify a JDBC configuration that can be used to establish a database export connection. |
int |
export(Object[] keys,
Object[][] data)
Inserts the data passed as the second argument into the database table to which we are connected. |
boolean |
getFileFallback()
Returns false. |
Object[] |
getKeys()
Gets the keys to use when passing data to this exporter. |
String |
getName()
Returns a localized name for this exporter. |
static Properties |
loadConfig()
Tries to load a previously saved database export configuration. |
boolean |
setEncoding(String enc)
Does nothing. |
| Methods inherited from class net.sourceforge.mp3dings.export.DatabaseConnection |
|---|
close, editConfig, getConnection, isAlive, loadConfig |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DatabaseExporter(Properties config,
ClassLoaderProvider clp)
throws ExportException,
SQLException
editConfig method.
config - the jdbc configurationclp - a classloader provider that manages the dynamic class path
for loading the JDBC driver, may be null
ExportException - if a required property is missing in
config, or if the JDBC driver cannot be loaded
SQLException - if an SQL/JDBC error occurs| Method Detail |
|---|
public static Properties editConfig(Component parent,
Properties config,
Field[] availableFields,
ClassLoaderProvider clp)
throws SQLException
parent - the GUI component to use as a dialog ownerconfig - the previous configuration if any, may be nullavailableFields - the fields that are available in the mp3dings table
that will exchange data with the databaseclp - a classloader provider that manages the dynamic class path
for loading the JDBC driver, may be null
SQLExceptionMp3dingsTableModel.getFields()
public static Properties loadConfig()
throws IOException
null if no such configuration exists
IOException - if the JDBC configuration cannot be read from
the properties file whose location was stored in the preferences
public int export(Object[] keys,
Object[][] data)
throws ExportException
export in interface Exporterdata - data[i][j] is the value for
keys[j] in the ith record
ExportExceptiongetKeys()public Object[] getKeys()
getKeys in interface ExporterField objectspublic boolean getFileFallback()
false.
getFileFallback in interface Exporterpublic boolean setEncoding(String enc)
setEncoding in interface Exporterenc - ignoredpublic String getName()
getName in interface Exporter
|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||