×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: bilal baig
Added: Dec 18, 2017 3:23 PM
Views: 8
Tags: no tags
  1. package dom;
  2.  
  3. import java.sql.SQLException;
  4. import java.util.ArrayList;
  5.  
  6. /*
  7.  * To change this license header, choose License Headers in Project Properties.
  8.  * To change this template file, choose Tools | Templates
  9.  * and open the template in the editor.
  10.  */
  11. /**
  12.  *
  13.  * @author Iqbal Ahmed
  14.  */
  15. public class Ledger {
  16.  
  17.     private ArrayList<String> Ledger = new ArrayList();
  18.     private String L;
  19.  
  20.     public ArrayList<String> getLedger() {
  21.         return Ledger;
  22.     }
  23.  
  24.     public void setLedger(ArrayList<String> Ledger) {
  25.         this.Ledger = Ledger;
  26.     }
  27.  
  28.     public String getL() {
  29.         return L;
  30.     }
  31.  
  32.     public Ledger() {
  33.     }
  34.  
  35.     public void setL(String L) {
  36.         this.L = L;
  37.     }
  38.  
  39.     @Override
  40.     public String toString() {
  41.         return Ledger.toString();
  42.     }
  43.  
  44.     public void addToLedger(String L) {
  45.         Ledger.add(L);
  46.     }
  47.  
  48.     public void addToDatabase(String L) {
  49.         DataBaseManager a = new DataBaseManager();
  50.         a.insertInLedger(L);
  51.     }
  52.  
  53.     public ArrayList<String> getAll() throws SQLException
  54.     {
  55.         DataBaseManager a = new DataBaseManager();
  56.         return a.getFromLedger();
  57.     }
  58.  
  59. }
  60.