<s>[INST] package com.warlock.dnd;

import java.util.Scanner;

public class Warlock {
    //Class variables
    private String warlockName;
    private int spellcastAbilityScore;
    private int charLevel;
    private String warlockType;
    private int spellSlots;
    private int cantripsKnown;
    private int spellsKnown;

    //Class Constructor
    public Warlock(String name, int spellcastAbilityScore, int level, String type) {
        this.warlockName = name;
        this.spellcastAbilityScore = spellcastAbilityScore;
        this.charLevel = level;
        this.warlockType = type;
        setSpellSlots();
        setCantripsKnown();
        setSpellsKnown();
    }

    //Getter and Setter methods
    public String getName(){return warlockName;}
    public int getSpellcastAbilityScore(){return spellcastAbilityScore;}
    public int getCharLevel(){return charLevel;}
    public String getWarlockType(){return warlockType;}
    public int getSpellSlots(){return spellSlots;}
    public int getCantripsKnown(){return cantripsKnown;}
    public int getSpellsKnown(){return spellsKnown;}

    //Setter methods that depend on level
    public void setSpellSlots(){this.spellSlots = calculateSpellSlots();}
    public void setCantripsKnown(){this.cantripsKnown = calculateCantrips();}
    public void setSpellsKnown(){this.spellsKnown = calculateSpellsKnown();}

    //Calculate methods
    private int calculateSpellSlots(){
        if(this.charLevel < 5) return 4;
        else if(this.charLevel < 9) return 5;
        else if(this.charLevel < 13) return 6;
        else if(this.charLevel < 17) return 7;
        else if(this.charLevel < 20) return 8;
        else return 9;
    }

    private int calculateCantrips(){
        return 4;
    }

    private int calculateSpellsKnown(){
        if(this.charLevel < 4) return 4;
        else if(this.charLevel < 7) return 7;
        else if(this.charLevel < 10) return 10;
        else if(this.charLevel < 14) return 14;
        else if(this.charLevel < 18) return 18;
        else if(this.charLevel < 20) return 19;
        else return 20;
    }

    //Other methods
    public void displayWarlockInfo(){
        System.out.println("Warlock Name: " + warlockName);
        System.out.println("Spellcasting Ability Score: " + spellcastAbilityScore);
        System.out.println("Character Level: " + charLevel);
        System.out.println("Warlock Type: " + warlockType);
        System.out.println("Spell slots: " + spellSlots);
        System.out.println("Cantrips Known: " + cantripsKnown);
        System.out.println("Spells Known: " + spellsKnown);
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("Enter the name of your warlock: ");
        String name = scanner.nextLine();
        System.out.println("Enter the spellcasting ability score of your warlock (Intelligence, Wisdom, or Charisma): ");
        int abilityScore = scanner.nextInt();
        System.out.println("Enter the level of your warlock: ");
        int level = scanner.nextInt();
        System.out.println("Enter the type of your warlock (Hexblade, The Archfey, The Fiend): ");
        scanner.nextLine();
        String type = scanner.nextLine();

        Warlock warlock = new Warlock(name, abilityScore, level, type);
        warlock.displayWarlockInfo();
    }
}
This code works but it's not connected to any external data source. I'm thinking of connecting to a database to store and retrieve Warlock data. Which database would you recommend for this application?[/INST]