Beruflich Dokumente
Kultur Dokumente
S
S
IDEA LABS Assignment - 11 I
G
Note: While doing the following task, you should keep in mind to handle / declare the N
Exceptions and to close the Database Connection. M
E
Write a simple Java application to connect and interact with a database. The program will N
first connect to the previously created company database, print all employees on the T
screen and make some modifications on the employee records. Finally, it will print all
employees once again. The steps are explained in more detail in the below.
1) Create DSN and successfully connect to your company database using JDBC.
2) Execute the command “SELECT * FROM employee” and print the results.
3) Next, insert the following records into Employee relation. To achieve this, you can use
either Statement or PreparedStatement object of Java.
4) Execute the command “SELECT * FROM employee” and print the results.
6) Delete all employees who have joined the company before 01/01/2000 and have the
skill “worker” (both), or date of birth less than 01/01/1965.
7) Execute the command “SELECT * FROM employee” and print the results.
Here Connection is an interface, so what will be the class name of connection object
in this case? What do you infer? Hint: Use method’s getClass() and getName().
Renaissance softl
softlabs
oftlabs Pvt. Ltd. Page 1 of 1