Details of this Paper

Stock tracker and Debugging

Description

solution


Question

1. Programming assignment.;2. 8 question debugging exercise;4 Using a Database Qu ery Result;Write a Java program to query the StockTracker database for all users and all stocks held by each user. List the user?s ID, first name, and last name followed by their stocks, including both the stock symbol and stock description (name). This can be a console application that produces output to the screen, as shownin Figure 11-80. Use the project, StockTracker, to add additional users and stocks, if necessary. For an extra challenge, use only the StockTrackerDB data access class to obtain data from the database.;Figure 11-80.;Debugging Assignment;Find and fix the error in each line of code. Each line contains only one error.;Indented lines continue the previous statement.;1. forName("sun.jdbc.odbc.JdbcOdbcDriver");2. String dbn = " AutoParts;3. Connection con = getConnection(dbn);4. Statement stmt = DriverManager.createStatement();5. stmt.executeUpdate("CREATE TABLE StockItemsitemID INT;6. +"CONSTRAINT PK_Item PRIMARY,;7. + "CONSTRAINT FK1_Item REFERENCES PartDesc (partno);8. +"qtyOnHand INT, price SINGLE, cost SINGLE")

 

Paper#70796 | Written in 18-Jul-2015

Price : $32
SiteLock