Package me.scolastico.mysql.manager
Class MysqlManager
- java.lang.Object
-
- me.scolastico.mysql.manager.MysqlManager
-
public class MysqlManager extends Object
-
-
Constructor Summary
Constructors Constructor Description MysqlManager(String sqLiteFileName)MysqlManager(String host, int port, String db, String username, String password)MysqlManager(String host, int port, String db, String username, String password, String additionalArguments)
-
Method Summary
Modifier and Type Method Description voidcloseConnection()voiddelete(Object table, Long id)voiddeleteTable(Object table)voidgenerateTable(Object table)Object[]getAllFromTable(Object table)ConnectiongetConnection()ObjectgetFromTableById(Object table, Long id)Object[]getFromTableBySearch(Object table, String name, Object object)longsaveTable(Object table)voidupdateTable(Object table)
-
-
-
Constructor Detail
-
MysqlManager
public MysqlManager(String sqLiteFileName) throws SQLException
- Throws:
SQLException
-
MysqlManager
public MysqlManager(String host, int port, String db, String username, String password) throws SQLException
- Throws:
SQLException
-
MysqlManager
public MysqlManager(String host, int port, String db, String username, String password, String additionalArguments) throws SQLException
- Throws:
SQLException
-
-
Method Detail
-
generateTable
public void generateTable(Object table) throws NotATableException, SQLException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, NoSuchFieldException, NoFieldsException, NotSavedEntryException, NoDataException
-
getFromTableById
public Object getFromTableById(Object table, Long id) throws NotATableException, SQLException, IllegalAccessException, NoSuchFieldException, InvocationTargetException, NoSuchMethodException
-
getFromTableBySearch
public Object[] getFromTableBySearch(Object table, String name, Object object) throws NotATableException, SQLException, InvocationTargetException, IllegalAccessException, NoSuchMethodException, NoSuchFieldException, InstantiationException
-
getAllFromTable
public Object[] getAllFromTable(Object table) throws NotATableException, SQLException, InvocationTargetException, IllegalAccessException, NoSuchMethodException, NoSuchFieldException, InstantiationException
-
delete
public void delete(Object table, Long id) throws NotATableException, SQLException
- Throws:
NotATableExceptionSQLException
-
deleteTable
public void deleteTable(Object table) throws NotATableException, SQLException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, NoSuchFieldException, NotSavedEntryException
-
updateTable
public void updateTable(Object table) throws NotATableException, NoFieldsException, NoSuchFieldException, IllegalAccessException, SQLException, NoSuchMethodException, InvocationTargetException, NoDataException
-
saveTable
public long saveTable(Object table) throws IllegalAccessException, SQLException, NotATableException, NoFieldsException, NoSuchMethodException, InvocationTargetException, NoDataException
-
getConnection
public Connection getConnection()
-
closeConnection
public void closeConnection() throws SQLException- Throws:
SQLException
-
-