You are on page 1of 4

Case Study – Medical Central Supplies

The Project folder


contains the following folders and files:
􀂄 client
􀂄 Server
􀂄 Auth_tab.sql
􀂄 Inv_tab.sql
􀂄 Inventory_db.sql
Copy the Project folder on the local disk of the system.
You need to ensure the following before running the project:
􀂄 The SQL server should be installed with the SQL Server authentication mode with
the user name as “sa”. The password of the SQL server authentication should be
“password@123”. You also need to create the datasource by the name ‘IDB’.
􀂄 JDK 6 and NetBeans 6.0.1 IDE should be installed on the system.
You need to perform the following tasks to execute the solution:
1. Open the application in NetBeans 6.0.1.
2. Connect to the SQL Server.
3. Create the datasource.
4. Build and execute the server-side application.
5. Build and execute the client application.
Task 1: Opening the Application in NetBeans 6.0.1
To open the application in NetBeans 6.0.1, you need to perform the following steps:
1. Select start􀃆All Programs􀃆NetBeans􀃆NetBeans IDE 6.0.1. The NetBeans IDE
6.0.1 window appears.
2. Select File􀃆Open Project. The Open Project dialog box appears.
3. Browse to the following location:
<drive letter>:/Project/client
4. Select the Inventorymgntapplication project.

5. Click the Open Project button. The Open Project dialog box appears, as shown in
the following figure.
The Open Project Dialog Box
6. Click the Close button.
7. Repeat steps 2 to 6 to open the AuthenticServer project.
8. Right-click the Inventorymgntapplication project in the Projects pane, and then
select the Resolve Reference Problems option. The Resolve Reference Problems
window appears.
9. Either of the following types of problems can be displayed in the Reference
Problems section:
a. If the “Inventorymgntapplication-res” file/folder could not be found option is
selected in the Reference Problems section, then click the Resolve button. The
Browse window appears.
b. Browse to the location where the res folder is present.
c. Select the res folder, and then click the Open button.
d. Repeat the steps a to c for resolving the problem,
“Inventorymgntapplication-res” file/folder could not be found”.
e. Click the Close button.
OR
a. If the “Imported Project-Inventorymgntapplication” file/folder could not be
found option is selected in the Reference Problems section, then click the
Resolve button. The Browse window appears.
b. Browse to the location where the Inventorymgntapplication folder is present.
c. Select the Inventorymgntapplication folder, and then click the Open button.
d. Click the Close button.

10. Right-click the Inventorymgntapplication project in the Projects pane, and then
select the Properties option.
11. Select Platform from the Category section.
12. Ensure that the Sun Java(TM) Wireless Toolkit 2.5.2 for CLDC option is selected
in the Emulator Platform drop-down list.
13. Click the OK button.
Task 2: Connecting to the SQL Server
To connect to the SQL server, you need to perform the following steps:
1. Select start􀃆All Programs􀃆Microsoft SQL Server 2005􀃆SQL Server
Management Studio. The Connect to Server dialog box appears.
2. Enter the server name, login, and password details according to your center
specifications.
3. Ensure that the SQL Server Authentication option is selected from the
Authentication drop-down list.
4. Click the Connect button. The Microsoft SQL Server Management Studio
window appears.
5. Select File􀃆Open􀃆 File. Browse to the location where the Inventory_db file is
located.
6. Click the Open button. The file is opened in the Inventory_db tab.
7. Press the F5 button to execute the script.
8. Repeat steps 5 to 7 to open the Auth_tab and Inv_tab script files and execute them.
Task 3: Creating a Datasource
To create a datasource, you need to perform the following steps:
1. Select start􀃆Settings􀃆Control Panel. The Control Panel window appears.
2. Double-click the Administrative Tools icon. The Administrative Tools window
appears.
3. Double-click the Data Sources (ODBC) icon. The ODBC Data Source
Administrator dialog box appears.
4. Ensure that the User DSN tab is selected.
5. Click the Add button. The Create New Data Source dialog box appears.
6. Select the SQL Server driver, and then click the Finish button.
7. Type IDB in the Name text box.
8. Enter the SQL Server name in the Server combo box.
9. Click the Next button.

10. Select the With SQL Server authentication using a login ID and password
entered by the user option.
11. Type sa in the Login ID text box.
12. Type password@123 in the Password text box.
13. Click the Next button.
14. Select the Change the default database to check box.
15. Select the INVENTORY_DB option in the combo box below the Change the
default database to check box.
16. Click the Next button.
17. Click the Finish button.
18. Click the OK button.
19. Click the OK button.
20. Switch to the NetBeans window.
Task 4: Building and Executing the Server-side Application
To build and execute the server-side application, you need to perform the following steps:
1. Right-click the AuthenticServer project in the Projects pane, and then select the
Build option.
2. Right-click the AuthenticServer project in the Projects pane, and then select the
Undeploy and Deploy option to start the server.
Task 5: Building and Executing the Client Application
To build and execute the client-side application, you need to perform the following steps:
1. Right-click the Inventorymgntapplication project in the Project pane, and then
select the Build option.
2. Right-click the Inventorymgntapplication project in the Project pane, and then
select the Run option. The DefaultColorPhone emulator window appears with the
following options:
􀁺 Check_Availablity_Inventory
􀁺 Sales_Description
􀁺 Check_Sales
3. Click the soft key below Launch to launch the MIDlet. The Login to inventory
screen is displayed.
4. Type sa in the Login text box.
5. Click the down-arrow key in the emulator keypad.
6. Type password@123 in the Enter Password text box.

7. Click the soft key below Menu. A menu is displayed on the screen of the mobile
screen.
8. Ensure that the Ok option is selected on the menu, and then click the OK button on
the keypad of the emulator.
9. The Is it OK to Use Airtime ? screen is displayed.
10. Click the soft key below Yes. The Main_Menu is displayed.
11. Explore the options by using the arrow keys of the emulator and the soft keys to
navigate between different screens of the application.
12. Select MIDlet􀃆Exit to close the DefaultColorPhone emulator window.
13. Select File􀃆Exit to close the NetBeans IDE.
The Inventorymgntapplication project for Medical Central Supplies contains the
following Java files and servlets:
􀂄 Communicator.java: Is used to execute the task invoked by the EventHandler
class. The EventHandler class is used to handle various events generated as a result
of the user interaction with the user interface of Inventory Management application.
􀂄 DataManagement.java: Defines the containers to store the completed tasks and the
data returned by them.
􀂄 EventHandler.java: Handles the various events, which are generated when the user
interacts with the GUI of the Inventory management System.
􀂄 ExtendedCommand.java: Defines the set of commands, which are to be handled in
the EventHandler class.
􀂄 Inventory_Midlet.java: Implements various MIDP UI classes to generate the
various screens of the Inventory Management Application.
􀂄 PlayingSound.java: Implements the multimedia functionalities of the Inventory
Management application. It defines various MMAPI classes and interfaces that can
be used to implement the classes and interfaces.
􀂄 Sales.java: Implements the sales form of the application, which displays the
information about sales done by the current personnel.
􀂄 SalesInfo.java: Retrieves the current sales information and displays it to the user.
􀂄 NewSales.java: Implements the module that enables the sales personnel to add
information about new sales in their mobile devices.
􀂄 SplashScreen.java: Displays a screen with an image, while the inventory data is
being requested from the server.
􀂄 TaskName.java: Implements the various types of tasks that are requested from the
clients. For example, it defines methods, such as makeLoginRequest() and
makeInventoryrequest() which are used for requesting login authentication and
inventory data retrieval respectively.

Authentication_Servlet.java: Handles various client requests for various tasks, such


as login authentication, and inventory information retrieval.
􀂄 DBCall.java: Creates the database connections and queries the database to return the
results to the servlet, Authentication_Servlet.java.

You might also like