public class SQLiteUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
BATCH_LIMIT |
static int |
BATCH_LIMIT_MATRIX_LINE |
Constructor and Description |
---|
SQLiteUtils() |
Modifier and Type | Method and Description |
---|---|
void |
copyTable(String db,
String table,
String newDB,
String tableNew)
Copy a table.
|
void |
createTableDB(String filepath,
String db,
String tableName)
Create a SQLlite database from a tabular file.
|
void |
dropColumns(String db,
String table,
Set<String> columnsToDrop)
Drop specified columns from the table
|
void |
dropTable(String db,
String table)
Drop a table from a database
|
void |
flushTableInFile(String sqlLiteDB,
String table,
String outfile)
Flush a table in a tabular file The first two columns are considered as
literal, the others as Double values
The number of tuples load into memory before flushing are governed by
BATCH_LIMIT_MATRIX_LINE
|
int |
getBATCH_LIMIT_MATRIX_LINE() |
int |
getBATCH_LIMIT() |
void |
getInfo(String db)
Return info a specified database
|
void |
getInfo(String db,
String table)
Return info a specified table
|
void |
mergeTables(String db_tAB,
String table_A,
String table_B,
String db_tmerge,
String table_merge)
Merge two tables of a same database into a new table located in another
database.
|
void |
mergeTables(String db_tA,
String table_A,
String db_tB,
String table_B,
String db_tmerge,
String table_merge)
Merge two tables into a new table.
|
void |
renameTable(String db,
String table,
String newTableName)
Rename a table in a database.
|
void |
setBATCH_LIMIT_MATRIX_LINE(int bATCH_LIMIT_MATRIX_LINE)
Mutator of the number of values stored by line.
|
void |
setBATCH_LIMIT(int BATCH_LIMIT)
Setter of the number of value stored in memory.
|
public static int BATCH_LIMIT
public static int BATCH_LIMIT_MATRIX_LINE
public void createTableDB(String filepath, String db, String tableName) throws slib.utils.ex.SLIB_Ex_Critic
filepath
- the tabular file containing the resultsdb
- the name of the database to considertableName
- the name of the table where to flush the resultsslib.utils.ex.SLIB_Ex_Critic
public void mergeTables(String db_tAB, String table_A, String table_B, String db_tmerge, String table_merge) throws slib.utils.ex.SLIB_Exception
db_tAB
- database of the tables to mergetable_A
- first table nametable_B
- second table namedb_tmerge
- database in which the merge table will be created
(different from db_tAB)table_merge
- the name of the new tableslib.utils.ex.SLIB_Exception
public void mergeTables(String db_tA, String table_A, String db_tB, String table_B, String db_tmerge, String table_merge) throws slib.utils.ex.SLIB_Ex_Critic
db_tA
- database of the first table to mergetable_A
- first table namedb_tB
- database of the second table to mergetable_B
- second table namedb_tmerge
- database in which the merge table will be createdtable_merge
- the name of the new tableslib.utils.ex.SLIB_Ex_Critic
public void flushTableInFile(String sqlLiteDB, String table, String outfile) throws slib.utils.ex.SLIB_Ex_Critic
sqlLiteDB
- the database containing the table to considertable
- the name of the tableoutfile
- the file in which the table will be flushslib.utils.ex.SLIB_Ex_Critic
public void copyTable(String db, String table, String newDB, String tableNew) throws slib.utils.ex.SLIB_Ex_Critic
db
- the database containing the table to copytable
- the name of the tablenewDB
- the name of the database where the new table will be createdtableNew
- slib.utils.ex.SLIB_Ex_Critic
public void dropColumns(String db, String table, Set<String> columnsToDrop) throws slib.utils.ex.SLIB_Ex_Critic
db
- the database containing the table to processtable
- the table to processcolumnsToDrop
- a list of strings corresponding to the columns to
delete
SQLlite do not support ALTER column, a temporal copy of the table is
performed during the processslib.utils.ex.SLIB_Ex_Critic
public void dropTable(String db, String table) throws slib.utils.ex.SLIB_Ex_Critic
db
- the databasetable
- the name of table to dropslib.utils.ex.SLIB_Ex_Critic
public void getInfo(String db) throws slib.utils.ex.SLIB_Ex_Critic
db
- the databaseslib.utils.ex.SLIB_Ex_Critic
public void getInfo(String db, String table) throws slib.utils.ex.SLIB_Ex_Critic
db
- the databasetable
- the tableslib.utils.ex.SLIB_Ex_Critic
public void renameTable(String db, String table, String newTableName) throws slib.utils.ex.SLIB_Ex_Critic
db
- table
- newTableName
- slib.utils.ex.SLIB_Ex_Critic
public int getBATCH_LIMIT()
public void setBATCH_LIMIT(int BATCH_LIMIT)
BATCH_LIMIT
- public int getBATCH_LIMIT_MATRIX_LINE()
public void setBATCH_LIMIT_MATRIX_LINE(int bATCH_LIMIT_MATRIX_LINE)
bATCH_LIMIT_MATRIX_LINE
- Copyright © 2014. All rights reserved.