```java
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Note {
    private int id;
    private String title;
    private String content;

    public Note(int id, String title, String content) {
        this.id = id;
        this.title = title;
        this.content = content;
    }

    // Getters and setters

    @Override
    public String toString() {
        return "Note{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                '}';
    }
}

class DatabaseHelper {

    private static final String DB_NAME = "notes.db";
    private Connection connection;

    public DatabaseHelper() throws SQLException {
        connect();
        createTableIfNotExists();
    }

    private void connect() throws SQLException {
        connection = DriverManager.getConnection("jdbc:sqlite:" + DB_NAME);
    }

    private void createTableIfNotExists() throws SQLException {
        String sql = "CREATE TABLE IF NOT EXISTS notes (id INTEGER PRIMARY KEY, title TEXT, content TEXT)";
        try (Statement stmt = connection.createStatement()) {
            stmt.execute(sql);
        }
    }

    public List<Note> getAllNotes() throws SQLException {
        List<Note> notes = new ArrayList<>();
        String sql = "SELECT * FROM notes";
        try (Statement stmt = connection.createStatement();
             ResultSet rs = stmt.executeQuery(sql)) {

            while (rs.next()) {
                int id = rs.getInt("id");
                String title = rs.getString("title");
                String content = rs.getString("content");
                notes.add(new Note(id, title, content));
            }
        }
        return notes;
    }

    public void addNote(String title, String content) throws SQLException {
        String sql = "INSERT INTO notes(title, content) VALUES(?, ?)";
        try (PreparedStatement pstmt = connection.prepareStatement(sql)) {
            pstmt.setString(1, title);
            pstmt.setString(2, content);
            pstmt.executeUpdate();
        }
    }

    public void updateNote(int id, String title, String content) throws SQLException {
        String sql = "UPDATE notes SET title = ?, content = ? WHERE id = ?";
        try (PreparedStatement pstmt = connection.prepareStatement(sql)) {
            pstmt.setString(1, title);
            pstmt.setString(2, content);
            pstmt.setInt(3, id);
            pstmt.executeUpdate();
        }
    }

    public void deleteNote(int id) throws SQLException {
        String sql = "DELETE FROM notes WHERE id = ?";
        try (PreparedStatement pstmt = connection.prepareStatement(sql)) {
            pstmt.setInt(1, id);
            pstmt.executeUpdate();
        }
    }

    public List<Note> searchNotes(String keyword) throws SQLException {
        List<Note> notes = new ArrayList<>();
        String sql = "SELECT * FROM notes WHERE title LIKE ? OR content LIKE ?";
        try (PreparedStatement pstmt = connection.prepareStatement(sql)) {
            pstmt.setString(1, "%" + keyword + "%");
            pstmt.setString(2, "%" + keyword + "%");

            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                int id = rs.getInt("id");
                String title = rs.getString("title");
                String content = rs.getString("content");
                notes.add(new Note(id, title, content));
            }
        }
        return notes;
    }

    public void close() throws SQLException {
        if (connection != null) {
            connection.close();
        }
    }
}

public class Main {

    private static DatabaseHelper dbHelper;
    private static Scanner scanner;

    public static void main(String[] args) {
        try {
            dbHelper = new DatabaseHelper();
            scanner = new Scanner(System.in);

            boolean exit = false;
            while (!exit) {
                System.out.println("\nChoose an option:");
                System.out.println("1. Add note");
                System.out.println("2. Edit note");
                System.out.println("3. Delete note");
                System.out.println("4. View all notes");
                System.out.println("5. Search notes");
                System.out.println("6. Exit");

                int choice = scanner.nextInt();
                scanner.nextLine(); // Consume newline left-over

                switch (choice) {
                    case 1:
                        addNote();
                        break;
                    case 2:
                        editNote();
                        break;
                    case 3:
                        deleteNote();
                        break;
                    case 4:
                        viewAllNotes();
                        break;
                    case 5:
                        searchNotes();
                        break;
                    case 6:
                        exit = true;
                        break;
                    default:
                        System.out.println("Invalid option. Try again.");
                }
            }

        } catch (SQLException e) {
            System.err.println(e.getMessage());
        } finally {
            try {
                if (dbHelper != null) {
                    dbHelper.close();
                }
            } catch (SQLException e) {
                System.err.println(e.getMessage());
            }
        }
    }

    private static void addNote() throws SQLException {
        System.out.print("Enter note title: ");
        String title = scanner.nextLine();
        System.out.print("Enter note content: ");
        String content = scanner.nextLine();

        dbHelper.addNote(title, content);
        System.out.println("Note added successfully!");
    }

    private static void editNote() throws SQLException {
        viewAllNotes();

        System.out.print("Enter the ID of the note to edit: ");
        int id = scanner.nextInt();
        scanner.nextLine(); // Consume newline left-over

        System.out.print("Enter new note title: ");
        String title = scanner.nextLine();
        System.out.print("Enter new note content: ");
        String content = scanner.nextLine();

        dbHelper.updateNote(id, title, content);
        System.out.println("Note updated successfully!");
    }

    private static void deleteNote() throws SQLException {
        viewAllNotes();

        System.out.print("Enter the ID of the note to delete: ");
        int id = scanner.nextInt();

        dbHelper.deleteNote(id);
        System.out.println("Note deleted successfully!");
    }

    private static void viewAllNotes() throws SQLException {
        List<Note> notes = dbHelper.getAllNotes();
        for (Note note : notes) {
            System.out.println(note);
        }
    }

    private static void searchNotes() throws SQLException {
        System.out.print("Enter keyword to search: ");
        String keyword = scanner.nextLine();

        List<Note> notes = dbHelper.searchNotes(keyword);
        for (Note note : notes) {
            System.out.println(note);
        }
    }
}
```
```java
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Note {
    private int id;
    private String title;
    private String content;

    public Note(int id, String title, String content) {
        this.id = id;
        this.title = title;
        this.content = content;
    }

    // Getters and setters

    @Override
    public String toString() {
        return "Note{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                '}';
    }
}

class DatabaseHelper {

    private static final String DB_NAME = "notes.db";
    private Connection connection;

    public DatabaseHelper() throws SQLException {
        connect();
        createTableIfNotExists();
    }

    private void connect() throws SQLException {
        connection = DriverManager.getConnection("jdbc:sqlite:" + DB_NAME);
    }

    private void createTableIfNotExists() throws SQLException {
        String sql = "CREATE TABLE IF NOT EXISTS notes (id INTEGER PRIMARY KEY, title TEXT, content TEXT)";
        try (Statement stmt = connection.createStatement()) {
            stmt.execute(sql);
        }
    }

    public List<Note> getAllNotes() throws SQLException {
        List<Note> notes = new ArrayList<>();
        String sql = "SELECT * FROM notes";
        try (Statement stmt = connection.createStatement();
             ResultSet rs = stmt.executeQuery(sql)) {

            while (rs.next()) {
                int id = rs.getInt("id");
                String title = rs.getString("title");
                String content = rs.getString("content");
                notes.add(new Note(id, title, content));
            }
        }
        return notes;
    }

    public void addNote(String title, String content) throws SQLException {
        String sql = "INSERT INTO notes(title, content) VALUES(?, ?)";
        try (PreparedStatement pstmt = connection.prepareStatement(sql)) {
            pstmt.setString(1, title);
            pstmt.setString(2, content);
            pstmt.executeUpdate();
        }
    }

    public void updateNote(int id, String title, String content) throws SQLException {
        String sql = "UPDATE notes SET title = ?, content = ? WHERE id = ?";
        try (PreparedStatement pstmt = connection.prepareStatement(sql)) {
            pstmt.setString(1, title);
            pstmt.setString(2, content);
            pstmt.setInt(3, id);
            pstmt.executeUpdate();
        }
    }

    public void deleteNote(int id) throws SQLException {
        String sql = "DELETE FROM notes WHERE id = ?";
        try (PreparedStatement pstmt = connection.prepareStatement(sql)) {
            pstmt.setInt(1, id);
            pstmt.executeUpdate();
        }
    }

    public List<Note> searchNotes(String keyword) throws SQLException {
        List<Note> notes = new ArrayList<>();
        String sql = "SELECT * FROM notes WHERE title LIKE ? OR content LIKE ?";
        try (PreparedStatement pstmt = connection.prepareStatement(sql)) {
            pstmt.setString(1, "%" + keyword + "%");
            pstmt.setString(2, "%" + keyword + "%");

            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                int id = rs.getInt("id");
                String title = rs.getString("title");
                String content = rs.getString("content");
                notes.add(new Note(id, title, content));
            }
        }
        return notes;
    }

    public void close() throws SQLException {
        if (connection != null) {
            connection.close();
        }
    }
}

public class Main {

    private static DatabaseHelper dbHelper;
    private static Scanner scanner;

    public static void main(String[] args) {
        try {
            dbHelper = new DatabaseHelper();
            scanner = new Scanner(System.in);

            boolean exit = false;
            while (!exit) {
                System.out.println("\nChoose an option:");
                System.out.println("1. Add note");
                System.out.println("2. Edit note");
                System.out.println("3. Delete note");
                System.out.println("4. View all notes");
                System.out.println("5. Search notes");
                System.out.println("6. Exit");

                int choice = scanner.nextInt();
                scanner.nextLine(); // Consume newline left-over

                switch (choice) {
                    case 1:
                        addNote();
                        break;
                    case 2:
                        editNote();
                        break;
                    case 3:
                        deleteNote();
                        break;
                    case 4:
                        viewAllNotes();
                        break;
                    case 5:
                        searchNotes();
                        break;
                    case 6:
                        exit = true;
                        break;
                    default:
                        System.out.println("Invalid option. Try again.");
                }
            }

        } catch (SQLException e) {
            System.err.println(e.getMessage());
        } finally {
            try {
                if (dbHelper != null) {
                    dbHelper.close();
                }
            } catch (SQLException e) {
                System.err.println(e.getMessage());
            }
        }
    }

    private static void addNote() throws SQLException {
        System.out.print("Enter note title: ");
        String title = scanner.nextLine();
        System.out.print("Enter note content: ");
        String content = scanner.nextLine();

        dbHelper.addNote(title, content);
        System.out.println("Note added successfully!");
    }

    private static void editNote() throws SQLException {
        viewAllNotes();

        System.out.print("Enter the ID of the note to edit: ");
        int id = scanner.nextInt();
        scanner.nextLine(); // Consume newline left-over

        System.out.print("Enter new note title: ");
        String title = scanner.nextLine();
        System.out.print("Enter new note content: ");
        String content = scanner.nextLine();

        dbHelper.updateNote(id, title, content);
        System.out.println("Note updated successfully!");
    }

    private static void deleteNote() throws SQLException {
        viewAllNotes();

        System.out.print("Enter the ID of the note to delete: ");
        int id = scanner.nextInt();

        dbHelper.deleteNote(id);
        System.out.println("Note deleted successfully!");
    }

    private static void viewAllNotes() throws SQLException {
        List<Note> notes = dbHelper.getAllNotes();
        for (Note note : notes) {
            System.out.println(note);
        }
    }

    private static void searchNotes() throws SQLException {
        System.out.print("Enter keyword to search: ");
        String keyword = scanner.nextLine();

        List<Note> notes = dbHelper.searchNotes(keyword);
        for (Note note : notes) {
            System.out.println(note);
        }
    }
}
```