Package server.manager
Class DatabaseManager
- java.lang.Object
-
- server.manager.DatabaseManager
-
public class DatabaseManager extends Object
-
-
Constructor Summary
Constructors Constructor Description DatabaseManager(CollectionManager cl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckAuth(String userLogin, String userPassword)booleancheckPermissionById(long movieID, String userLogin)voidcreateUser(String newUserPassword, String newUserLogin)booleandeleteMovieById(long movieId, String userLogin)booleandeleteMoviesGreaterThan(long id, String userLogin)ConnectiongetConnection()List<String>getEnumValues(String typeName)longinsertMovieToDb(Movie movie, String ownerLogin)LinkedList<Movie>loadCollection()booleanupdateMovie(long id, Movie newMovie, String userLogin)
-
-
-
Constructor Detail
-
DatabaseManager
public DatabaseManager(CollectionManager cl) throws SQLException
- Throws:
SQLException
-
-
Method Detail
-
getConnection
public Connection getConnection()
-
getEnumValues
public List<String> getEnumValues(String typeName) throws SQLException
- Throws:
SQLException
-
loadCollection
public LinkedList<Movie> loadCollection() throws SQLException
- Throws:
SQLException
-
insertMovieToDb
public long insertMovieToDb(Movie movie, String ownerLogin) throws SQLException
- Throws:
SQLException
-
deleteMovieById
public boolean deleteMovieById(long movieId, String userLogin) throws SQLException- Throws:
SQLException
-
deleteMoviesGreaterThan
public boolean deleteMoviesGreaterThan(long id, String userLogin) throws SQLException- Throws:
SQLException
-
updateMovie
public boolean updateMovie(long id, Movie newMovie, String userLogin) throws SQLException- Throws:
SQLException
-
checkAuth
public boolean checkAuth(String userLogin, String userPassword) throws SQLException
- Throws:
SQLException
-
checkPermissionById
public boolean checkPermissionById(long movieID, String userLogin) throws SQLException- Throws:
SQLException
-
createUser
public void createUser(String newUserPassword, String newUserLogin) throws SQLException
- Throws:
SQLException
-
-