Develop a Java application that should make use of Remote Method Invocation and a database. Your application should retrieve the fuel sales from the database then output the results in a graphical user interface. Your application should consist of the following:
Develop a Java application that should make use of Remote Method Invocation and a
a) - A database:
ï The database should be called Sells, and should have a table called provincialsales with the following table properties: saleID INT (Primary key), province(varchar), litres BIGINT
ï You are allowed to use any RDMS you are comfortable with.
b) - A Province class:
ï The province class should implement the serializable interface and have getter and setter methods to get entries from the database
c) - A remote object interface:
ï The remote interface should be called Sales. It should have a method that returns a list that comprises of objects from the Province class.
d) - A ConnectionImpl class:
ï The class should be called ConnectionImpl and should implement the Sales interface.
ï It should have a method to get the all provincial sales from the database and populate them to an ArrayList using the method defined in the Sales interface.
ï The method should connect to the database and retrieve all the information in the provincialsales table using the methods in the Province class.
ï The method should create an instance of the Province class were the values from the database are set. Afterward, these should be added to the ArrayList.
e) - A Server class:
ï It should extend the ConnectionImpl class and instantiate an instance of the ConnectionImpl class.
ï It should export the remote object from the ConnectionImpl class to stub and bind the remote object in the registry. (Hint: Use the UnicastRemoteObject class)
ï When the server class is running, it should output the message ìServer is readyî to System.
f) - A Client class:
ï The client class should locate a remote object from the RMI register and invoke the method from the ConnectionImpl class in order to retrieve provincialsales details added to the ArrayList.
ï Should have a method to iterate through the entire list and output the details into a JTable
ï Should have a method to iterate through the entire list and output the details into a JTable. Hint - make use of the methods in the Province class to get these details.
the results displayed in a JTable after running the application
Trending now
This is a popular solution!
Step by step
Solved in 2 steps