PROG2111关系数据库
【PROG2111关系数据库】Relational Databases – PROG2111 Assignment #1
Maximum group size: 2
Objectives:
‐To review file I/O basics
‐To simulate a database service by using any method like the one given in the requirements OR by
using Threads OR by simple File handling using multiple programs at the same time.
Description:
Method 1:
You will write a client‐server software system that demonstrates how a database system normally
operates in a network environment. Generally, a database system runs as a service that responds to
requests from an arbitrary list of sources. It is up to the database system to make sure data is secure and
integrity is maintained. For example, only those sources that are permitted should access or update the
data;
and only one source can update data at a time – even though several sources may be requesting to
update at the same time.
Method 2:
You can write a program that uses Threads for accessing and updating the same text file by many
processes.
Method 3:
Write down programsthat try to accessthe same file simultaneously running with each other. So, in effect
you will be needing one program/application that creates a text file and then other applications/programs
that can access and update the contents. You can use three applications/programs for this purpose.
Requirements:
- The database file consists of records with the following fields:
A. MemberID (as an integer)
B. FirstName (as a variable length string)
C. LastName (as a variable length string)
D. DateOfBirth (as a Date format supported by your OS) - Write a server program that will run continuously, listening for requests to write to the
database. There are only 3 requests that the server can respond to:
A. INSERT ‐ allows the insertion of new data. The data should be provided only as the
FirstName, LastName and DateOfBirth. The MemberID is automatically generated and
written to the file with the rest of the data. The automatically generated MemberID must be
sequential.
The server should only handle up to 40,000 records. This means that IDs of 1‐40,000 would
be valid.
If the INSERT command is not successful, an error should be returned to the client.
B. UPDATE – allows the modification of existing records. The client must provide a valid
MemberID, FirstName, LastName and DateOfBirth. Even though the data may not change,
all four values should be in the parameter list.
If the UPDATE command is not successful, an error should be returned to the client.
C. FIND – allows a client program to get the information of a specific MemberID. The server
should return all four data fields.
If the FIND command is not successful, an error should be returned to the client. - Write a client program that can query the database allowing you to use INSERT, UPDATE and
FIND commands
Hand in:
Method 1 Submission: - The Server command definitions/protocol document
- All source code
- Installation and usage instructions
- Document stating any problems or deficiencies (bug list) in the submitted program.
Method 2 Submission: - All source codes
- Usage instructions
Method 3 Submission: - All source codes
- Usage instructions
Please discuss if you are still unclear about the requirements by dropping an email. I will be available for
discussion on our class day that is Tuesday September 22,2020 after our regular class for some time.
推荐阅读
- Docker应用:容器间通信与Mariadb数据库主从复制
- 装聋作哑,关系融洽
- 数据库设计与优化
- 关系问句
- 数据库总结语句
- MySql数据库备份与恢复
- 数据库|SQL行转列方式优化查询性能实践
- 异性同事关系再好,一旦做了这5件事,就是想0距离接触
- 一般模型化关系——从模型是什么到如何起作用的基本答案
- R语言迹检验协整关系式_使用R语言进行协整关系检验