|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectseniorproj.DBConnect
public class DBConnect
Contains the lower level methods dealing with the database and constructing of sql queries.
Constructor Summary | |
---|---|
DBConnect()
|
Method Summary | |
---|---|
static boolean |
checkDup(java.lang.String[] names,
int index,
java.lang.String name)
Checks to see if the given name already exists in array. |
static boolean |
connection(java.lang.String username,
java.lang.String password,
java.lang.String db)
Connects the user to the database. |
static java.lang.String |
createWarehouse(java.lang.String name)
Creates the create table code for the main warehouse table. |
static java.lang.String |
execute(java.lang.String code)
Runs given sql code on the database and provides positive and negative feedback. |
static java.lang.String |
fillTable(java.lang.String tablename,
Column[] columns)
Creates the insert statements to fill a table. |
static Column[] |
getColumns(java.lang.String tablename)
Retrieves the columns for a given table name. |
static java.lang.String[] |
getTableNames()
Retrieves all of the tables available to the user from his/her account. |
static java.lang.String |
starTable()
Creates the insert statement for the main table of the data warehouse. |
static java.lang.String |
tableCode(java.lang.String name)
Creates table code for a given table. |
static java.lang.String |
traverseFKey(DependentVar var)
Creates the where clause for the sql by examining the foreign keys of attributes neighbors. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DBConnect()
Method Detail |
---|
public static boolean connection(java.lang.String username, java.lang.String password, java.lang.String db)
username
- Student's usernamepassword
- Student's passworddb
- Student's chosen db
public static java.lang.String[] getTableNames()
public static Column[] getColumns(java.lang.String tablename)
tablename
- Name of table to retrieve columns for
public static java.lang.String createWarehouse(java.lang.String name)
name
- Name of the central warehouse table
public static java.lang.String tableCode(java.lang.String name)
name
- Name of table to create the statement for
public static java.lang.String fillTable(java.lang.String tablename, Column[] columns)
tablename
- Name of the tablecolumns
- Columns of the given table
public static boolean checkDup(java.lang.String[] names, int index, java.lang.String name)
names
- names of currently stored columnsindex
- number of stored columns to searchname
- name of the column
public static java.lang.String traverseFKey(DependentVar var)
var
- Dependent variable to base traversal on
public static java.lang.String starTable()
public static java.lang.String execute(java.lang.String code)
code
- sql to execute
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |