configuration 1) Create a database with Microsoft Access and save it as Database1.accdb. If you don’t have Access you can use an openSource software such as LibreOffice 2) Create a table for Students as shown in the following picture: Write a Java code to create a table “Employee” as shown below Perform add, search and delete record operations in forma of a Menu as show What do you like to do 2) Modify your code to add a new student record in your
configuration 1) Create a database with Microsoft Access and save it as Database1.accdb. If you don’t have Access you can use an openSource software such as LibreOffice 2) Create a table for Students as shown in the following picture: Write a Java code to create a table “Employee” as shown below Perform add, search and delete record operations in forma of a Menu as show What do you like to do 2) Modify your code to add a new student record in your
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Part I: configuration
1) Create a
2) Create a table for Students as shown in the following picture:
Write a Java code to create a table “Employee” as shown below
Perform add, search and delete record operations in forma of a Menu as show What do you like to do
-
2) Modify your code to add a new student record in your database
-
3) Modify your code to delete a student record from the database
-
4) Modify the code to search a student in the database using the ID number
-
Search a record
-
Add a record
-
Delete a record
4. Quit

Transcribed Image Text:Lab Manual
223CCS-3 Advanced Object Oriented Programming
2) Modify your code to add a new student record in your database
3) Modify your code to delete a student record from the database
4) Modify the code to search a student in the database using the ID number
Part III: (to finish at home)
Write a Java code to create a table “Employee" as shown below
Perform add, search and delete record operations in forma of a Menu as show
What do you like to do
1. Search a record
2. Add a record
3. Delete a record
4. Quit
SURNAME GENDER
Moore
Wilson
SALARY
STATE
California
EID
NAME
BIRTHDAY HIREDATE
DEPT
Rebecca
2 Ashley
3 Rachel
4 Emily
5 Ashley
6 Matthew
7 Alexis
8 Megan
1974-11-20 2005-03-11 R&D
1980-07-19 2008-03-16 Finance
New Mexico 1970-12-17 2010-12-01 Sales
1985-03-07 2006-08-15 HR
F
7000
F
New York
11000
Johnson
F
9000
Smith
F
Техas
7000
Smith
F
Техаs
1975-05-13 2004-07-30 R&D
1984-07-07 2005-07-07 Sales
1972-08-16 2002-08-16 Sales
1979-04-19 1984-04-19 Marketing
16000
Johnson
M
California
linois
California
.
11000
F
IF
Smith
9000
Wilson
11000
Davis
Johnson
Moore
Davis
Davis
|Wilson
9 Victoria
1983-12-07 2009-12-07 HR
Pennsylvania 1976-03-12 2006-03-12 R&D
1974-12-16 2004-12-16 Sales
1980-09-11 2008-09-11 Sales
1982-05-14 2010-05-14 Finance
1977-12-24 2005-12-24 Sales
F
Техаs
3000
10 Ryan
M
13000
11 Jacob
M
Техas
.
F
12000
12 Jessica
13 Daniel
14 Alyssa
New York
Florida
Florida
7000
M
10000
F
4000
![Mot Acces
Home Crete
Eitenal Dats
Date feos
A Cut
V1cending Seleon-
D
l ong A See
iter
a Coy
Pate
omat ter
temove Sert Y toggle te
OO . Lraes Decuments
Seach Deument
Ciebard
Sot a er
Organion
Ne
folde
Moset Access
Documents library
Amange by Felder
Includes 2lections
*feerte
Dete medted
AAM tder
1 0 AM Fetelder
102124 PM
Name
Type
Leraries
edi
coumepet
Filetelder
Hemegreve
Telal
File folder
SS 12 M telder
HA 62PM Fetelder
S0/S PM
Computer
SveddeChe
pene
11/4124PM Fletelder
Ne
122/27 124 PM Mcesoft Access
Sevepe Mo Ace Dbe C
Hide Folders
Teel
Seve
Cancel
3) Configure the Data Source (ODBC) as shown in the following picture to be able to use your
database with JDBC.
coeC Mo
Se tl
1- Go to ODBC
Source
Administration:
en De Sou
Cence
Nae
Dne
Control Panel
\System and
Security
Administrative
FCl Mont Acce Dr n aco
CLDESTOP D la
Cagpa
anced
ToolsiData
Sten Dt
Sources (ODBC)
2-click add and
selection the
driver
Select Obe
OceC Send e mon hwcoeaN
ende d A
theahe ndudng
De
De
3-click configure
Canc
De
4-add a name to
your database
VERS
ADMINSTRATO
DESTOP
ear
De
Pead Ory
S-click select to
select your
database file
Part II: JDBC
1) Write the following code and execute it to test if it can access to your database.
publicclassMyJDBCProgram {
publicstaticvoid main(String args[]) throws Exception {
String query = "SELECT * FROM Students";
Class.forName ("sun.jdbc.odbc.JdbcodbcDriver");
System.out.println("conencted");
Connection con = DriverManager.getConnection("jdbc:odbc:FirstDataBase");
Statement stmt = con.createStatement ();
ResultSetrs = stmt.executeQuery(query);
while (rs.next()) {
String t = rs.getString("FIRSTNAME");
inta= rs.getInt("LEVEL");
System.out.println(t+a);
} con.close();}
Page 13 of 29](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fd6958cdf-4f91-43b6-b867-7c57c228b054%2F05836f62-ffcf-4927-a197-28013f027d8b%2Fxczeenr_processed.png&w=3840&q=75)
Transcribed Image Text:Mot Acces
Home Crete
Eitenal Dats
Date feos
A Cut
V1cending Seleon-
D
l ong A See
iter
a Coy
Pate
omat ter
temove Sert Y toggle te
OO . Lraes Decuments
Seach Deument
Ciebard
Sot a er
Organion
Ne
folde
Moset Access
Documents library
Amange by Felder
Includes 2lections
*feerte
Dete medted
AAM tder
1 0 AM Fetelder
102124 PM
Name
Type
Leraries
edi
coumepet
Filetelder
Hemegreve
Telal
File folder
SS 12 M telder
HA 62PM Fetelder
S0/S PM
Computer
SveddeChe
pene
11/4124PM Fletelder
Ne
122/27 124 PM Mcesoft Access
Sevepe Mo Ace Dbe C
Hide Folders
Teel
Seve
Cancel
3) Configure the Data Source (ODBC) as shown in the following picture to be able to use your
database with JDBC.
coeC Mo
Se tl
1- Go to ODBC
Source
Administration:
en De Sou
Cence
Nae
Dne
Control Panel
\System and
Security
Administrative
FCl Mont Acce Dr n aco
CLDESTOP D la
Cagpa
anced
ToolsiData
Sten Dt
Sources (ODBC)
2-click add and
selection the
driver
Select Obe
OceC Send e mon hwcoeaN
ende d A
theahe ndudng
De
De
3-click configure
Canc
De
4-add a name to
your database
VERS
ADMINSTRATO
DESTOP
ear
De
Pead Ory
S-click select to
select your
database file
Part II: JDBC
1) Write the following code and execute it to test if it can access to your database.
publicclassMyJDBCProgram {
publicstaticvoid main(String args[]) throws Exception {
String query = "SELECT * FROM Students";
Class.forName ("sun.jdbc.odbc.JdbcodbcDriver");
System.out.println("conencted");
Connection con = DriverManager.getConnection("jdbc:odbc:FirstDataBase");
Statement stmt = con.createStatement ();
ResultSetrs = stmt.executeQuery(query);
while (rs.next()) {
String t = rs.getString("FIRSTNAME");
inta= rs.getInt("LEVEL");
System.out.println(t+a);
} con.close();}
Page 13 of 29
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY