The screen shown is used to enter the sales of the products into the sales and salesdetails tables. It utilizes the four depicted files ProductDAO.java, Product.java, PosDAO.java and Pos.java. The schema for the database is also depicted. The java code utilizes a jconnector to retrieve data from the database. When a product code is entered and then a quantity is entered, on the enter key pressed, the product code is sent to the getProduct(String ID) of a ProductDAO object and that function connects to the database and retrieves the data, placing it into a Product object and return this as Product object so that it can be placed into the Jtable of the PosGUI screen. Write the code for the getProduct(String ID) function located in the ProductDAO file. The code is equivalent to the prodid.
The screen shown is used to enter the sales of the products into the sales and salesdetails tables. It utilizes the four depicted files ProductDAO.java, Product.java, PosDAO.java and Pos.java. The schema for the database is also depicted. The java code utilizes a jconnector to retrieve data from the database. When a product code is entered and then a quantity is entered, on the enter key pressed, the product code is sent to the getProduct(String ID) of a ProductDAO object and that function connects to the database and retrieves the data, placing it into a Product object and return this as Product object so that it can be placed into the Jtable of the PosGUI screen. Write the code for the getProduct(String ID) function located in the ProductDAO file. The code is equivalent to the prodid.
The screen shown is used to enter the sales of the products into the sales and salesdetails tables. It utilizes the four depicted files ProductDAO.java, Product.java, PosDAO.java and Pos.java. The schema for the database is also depicted. The java code utilizes a jconnector to retrieve data from the database. When a product code is entered and then a quantity is entered, on the enter key pressed, the product code is sent to the getProduct(String ID) of a ProductDAO object and that function connects to the database and retrieves the data, placing it into a Product object and return this as Product object so that it can be placed into the Jtable of the PosGUI screen. Write the code for the getProduct(String ID) function located in the ProductDAO file. The code is equivalent to the prodid.
The screen shown is used to enter the sales of the products into the sales and salesdetails tables. It utilizes the four depicted files ProductDAO.java, Product.java, PosDAO.java and Pos.java. The schema for the database is also depicted. The java code utilizes a jconnector to retrieve data from the database. When a product code is entered and then a quantity is entered, on the enter key pressed, the product code is sent to the getProduct(String ID) of a ProductDAO object and that function connects to the database and retrieves the data, placing it into a Product object and return this as Product object so that it can be placed into the Jtable of the PosGUI screen. Write the code for the getProduct(String ID) function located in the ProductDAO file. The code is equivalent to the prodid.
Transcribed Image Text:Point of Sales Screen
Product Code 4225
Code
9813
3700
Product Name
Wine Muscadet Sur Lie
Compound - Rum
Save Transaction
Cancel Transaction
Quantity 20
Unit Price
34.1
32.15
I
Qty Total
15
26
X
511.5
835.9
1347.40
Transcribed Image Text:public class ProductDAO {
private Connection conn;
PreparedStatement stmt = null;
public boolean openConnection() {
try {
// db parameters
String url = "jdbc:mysql://localhost: 4306/swen 2005";
String user = "root";
}
String password = "";
// create a connection to the database
conn = DriverManager.getConnection(url, user, password);
if (conn!= null){
|}
//System.out.println("Connection Successful");
return true;
}
catch(SQLException e) {
System.out.println(e.getMessage());
try
{
| }
return false;
}
public void closeConnection()
{
}
return false;
if (conn!=null)
conn.close();
}
catch (SQLException ex) {
System.out.println(ex.getMessage());
swen2005 sales
SalesNumber: int(10)
SalesDate : date
# Sales Total: decimal(7,2)
◆ swen2005 salesdetails
number: int(10)
# SalesNumber: int(10)
prodid: varchar(20)
# price: decimal(7,2)
#qty: int(10)
.
public class PosDAO {
private Connection conn;
PreparedStatement stmt = null;
public boolean openConnection(){
try {
}
// db parameters
String url = "jdbc: mysql://localhost: 4306/swen 2005";
String user="root";
String password = "";
// create a connection to the database
conn - DriverManager.getConnection(url, user, password);
if (conn!= null){
return true;
3
}
}
catch(SQLException e) {
System.out.println(e.getMessage());
}
return false;
}
public void closeConnection ()
{
try
{
return false;
}
}
if (conn!=null)
conn.close();
catch(SQLException ex) {
System.out.println(ex.getMessage());
}
public void saveTransaction (List <Salesdetails> items) throws SQLException{
}
public List<Pos> getSales (String fromDate, String toDate) {
v swen2005 products
number: int(11)
prodid: varchar(20)
prodname : varchar(30)
#price: decimal(10,2)
#onhand : int(11)
public class Pos {
class Product{
this.salesDate = sd;
this.salesNumber - sn;
this.prodcode = pcode;
this.qty = q;
this.prodname = pname;
this.unit = ucost;
this.salesTotal = st;
public int number;
public String prodID;
public String prodName;
public float prodPrice;
public int prodOnHand;
Product (int num, String id, String name, float price, int qty)
{
number-num;
prodID=id;
public String salesDate;
public int salesNumber;
public String prodcode;
public String prodname;
public double salesTotal;
public double unit;
public int qty;
public Pos(String sd,int sn, String pcode, String pname,double ucost, int q, double st)
{
prodName=name;
prodPrice=price;
prodOnHand-qty;
Organized collection of structured information, or data, typically stored in a computer system.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.