IDS 401
Assignment 6
You do not need previous assignments to complete Assignment 6.
First create a database in SQLite. The name of the database is JDBCAssign_abcd6, where abcd6 is your UIC netID. Within this databased, create a table named Accounts. This table should include the following columns: ID (primary key of the table, type Integer), Name (type Char), Balance (type Double).
Also, enter the following data into this table.
1
Alice
100
2
Bob
200
3
Catherine
300
4
Doug
100
5
Elija
200
In the main class, in addition to creating the getConnection method we discussed in class, you should also do the following
Send a SQL query and display all records with “Doug” as the value in Name column of the table. (20 points)
Send a SQL query and insert a new record in the table with the following information: ID:6, Name: Frank, Balance:400 (20 points)
Send a SQL query and update value for record in which the ID is 1. Set the new balance to be 200 for this record (15 points)
Send a SQL query and delete the record in which the ID is 6.(15 points)
Create a prepared statement. In this statement, you will ask user to enter the name. Then your code should display all records from the database whose value in Name column is user input. For example, if user enters Elija, your code should display: (30 points)
5 Elija 200