weka_experiment_DatabaseUtils.props

toc

= File =

= Description = Defines the database setup, i.e., JDBC driver information, JDBC URL, database type conversion, etc.

= Version =
 * >= 3.1.3

= Fields = >> the comma-separated list of jdbc drivers to try loading >> the JDBC URL to the database >> database specific datatype, e.g., >> database specific datatype, e.g., >> database specific datatype, e.g., >> necessary if database turns column names into upper case ones, e.g., HSQLDB >> necessary if database turns column names into lower case ones, e.g., PostgreSQL >> Checks whether the tables in the query are available in the meta-data of the JDBC Connection. Some tables, like, exist but are not available through the meta-data >> setting for >> whether to create a primary key in the results table of an experiment >> beyond this limit, nominal columns are loaded as STRING attributes and no longer as NOMINAL ones >> unique key in table that allows ordering for incremental loading >> lists all the reserved keywords of the current database type >> default: >> the character to append to attribute names/table names that would be interpreted as keywords by the database, in order to avoid exceptions when executing SQL commands >> defaut:
 * General
 * Table creation
 * Database flags
 * (> 3.5.3)
 * (> 3.5.3)
 * Special flags for DatabaseLoader/Saver (package )
 * (>= 3.4.1)
 * (>= 3.4.1)
 * (> 3.5.8, > 3.6.0)
 * (> 3.5.8, > 3.6.0)

= Database type mapping = In order to import the data from database correctly into Weka, one has to specify what JDBC datatype corresponds to what Java SQL retrieval method. Here's an overview of how the Java types are mapped to Weka's attribute types:


 * **Java type** || **Java method** || **Identifier** || **Weka attribute type** || **Version** ||
 * String || getString || 0 || nominal || ||
 * boolean || getBoolean || 1 || nominal || ||
 * double || getDouble || 2 || numeric || ||
 * byte || getByte || 3 || numeric || ||
 * short || getByte || 4 || numeric || ||
 * int || getInteger || 5 || numeric || ||
 * long || getLong || 6 || numeric || ||
 * float || getFloat || 7 || numeric || ||
 * date || getDate || 8 || date || ||
 * text || getString || 9 || string || >3.5.5 ||
 * time || getTime || 10 || string || >3.5.8 ||

In the props file one lists now the type names that the database returns and what Java type it represents (via the identifier), e.g.: code format="ini" CHAR=0 VARCHAR=0 code and are both String types, hence they are interpreted as //String// (identifier **0**)

code format="ini" DOUBLE_PRECISION=2 code
 * Note:** in case database types have blanks, one needs to replace those blanks with an underscore, e.g., must be listed like this:

= See also =
 * Databases
 * Properties file