Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.83 KB | None | 0 0
  1. package classes;
  2.  
  3. import interfaces.Playlist;
  4. import interfaces.SerializableStrategy;
  5. import interfaces.Song;
  6.  
  7. import java.io.IOException;
  8. import java.sql.Connection;
  9. import java.sql.DriverManager;
  10. import java.sql.PreparedStatement;
  11. import java.sql.SQLException;
  12.  
  13. public class JDBCStrategy implements SerializableStrategy{
  14.     Connection con;
  15.     PreparedStatement pst;
  16.  
  17.     @Override
  18.     public void openWritableLibrary() throws IOException, SQLException {
  19.         con = DriverManager.getConnection("jdbc:sqlite:lib.db");
  20.         pst = con.prepareStatement("CREATE TABLE IF NOT EXISTS  Lib (id long, title text, album text);");
  21.         pst.execute();
  22.     }
  23.  
  24.     @Override
  25.     public void openReadableLibrary() throws IOException {
  26.  
  27.     }
  28.  
  29.     @Override
  30.     public void openWritablePlaylist() throws IOException {
  31.  
  32.     }
  33.  
  34.     @Override
  35.     public void openReadablePlaylist() throws IOException {
  36.  
  37.     }
  38.  
  39.     @Override
  40.     public void writeSong(Song s) throws IOException {
  41.  
  42.     }
  43.  
  44.     @Override
  45.     public Song readSong() throws IOException, ClassNotFoundException, IDOverflowException {
  46.         return null;
  47.     }
  48.  
  49.     @Override
  50.     public void writeLibrary(Playlist p) throws IOException {
  51.  
  52.     }
  53.  
  54.     @Override
  55.     public Playlist readLibrary() throws IOException, ClassNotFoundException {
  56.         return null;
  57.     }
  58.  
  59.     @Override
  60.     public void writePlaylist(Playlist p) throws IOException {
  61.  
  62.     }
  63.  
  64.     @Override
  65.     public Playlist readPlaylist() throws IOException, ClassNotFoundException {
  66.         return null;
  67.     }
  68.  
  69.     @Override
  70.     public void closeWritableLibrary() {
  71.  
  72.     }
  73.  
  74.     @Override
  75.     public void closeReadableLibrary() {
  76.  
  77.     }
  78.  
  79.     @Override
  80.     public void closeWritablePlaylist() {
  81.  
  82.     }
  83.  
  84.     @Override
  85.     public void closeReadablePlaylist() {
  86.  
  87.     }
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement