Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package classes;
- import interfaces.Playlist;
- import interfaces.SerializableStrategy;
- import interfaces.Song;
- import java.io.IOException;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.PreparedStatement;
- import java.sql.SQLException;
- public class JDBCStrategy implements SerializableStrategy{
- Connection con;
- PreparedStatement pst;
- @Override
- public void openWritableLibrary() throws IOException, SQLException {
- con = DriverManager.getConnection("jdbc:sqlite:lib.db");
- pst = con.prepareStatement("CREATE TABLE IF NOT EXISTS Lib (id long, title text, album text);");
- pst.execute();
- }
- @Override
- public void openReadableLibrary() throws IOException {
- }
- @Override
- public void openWritablePlaylist() throws IOException {
- }
- @Override
- public void openReadablePlaylist() throws IOException {
- }
- @Override
- public void writeSong(Song s) throws IOException {
- }
- @Override
- public Song readSong() throws IOException, ClassNotFoundException, IDOverflowException {
- return null;
- }
- @Override
- public void writeLibrary(Playlist p) throws IOException {
- }
- @Override
- public Playlist readLibrary() throws IOException, ClassNotFoundException {
- return null;
- }
- @Override
- public void writePlaylist(Playlist p) throws IOException {
- }
- @Override
- public Playlist readPlaylist() throws IOException, ClassNotFoundException {
- return null;
- }
- @Override
- public void closeWritableLibrary() {
- }
- @Override
- public void closeReadableLibrary() {
- }
- @Override
- public void closeWritablePlaylist() {
- }
- @Override
- public void closeReadablePlaylist() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement