From 45656bf9ede70b10090cbd7631a6842785afc120 Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Mon, 30 Oct 2023 13:36:10 -0500 Subject: [PATCH] I hate Java ServerFaces --- .gitignore | 1 + .../Assignments/SuppliersPartsDatabase-5.zip | Bin 0 -> 17991 bytes .../nb-configuration.xml | 21 +++ .../SuppliersPartsDatabase/pom.xml | 88 +++++++++++ .../JakartaRestConfiguration.java | 13 ++ .../resources/JakartaEE9Resource.java | 20 +++ .../edu/slcc/asdv/beans/SupplierBean.java | 68 +++++++++ .../src/main/java/edu/slcc/asdv/bl/DBase.java | 22 +++ .../edu/slcc/asdv/bl/UtilitiesDatabase.java | 96 ++++++++++++ .../bl/part/DatabaseManipulationPart.java | 92 ++++++++++++ .../main/java/edu/slcc/asdv/bl/part/Part.java | 75 ++++++++++ .../DatabaseManipulationSupplier.java | 140 ++++++++++++++++++ .../edu/slcc/asdv/bl/supplier/Supplier.java | 110 ++++++++++++++ .../main/resources/META-INF/persistence.xml | 7 + .../src/main/webapp/WEB-INF/beans.xml | 6 + .../src/main/webapp/WEB-INF/glassfish-web.xml | 25 ++++ .../src/main/webapp/WEB-INF/web.xml | 24 +++ .../src/main/webapp/index.xhtml | 51 +++++++ .../src/main/webapp/resources/css/styles.css | 71 +++++++++ .../src/main/webapp/supplier.xhtml | 58 ++++++++ .../pom.xml | 10 ++ .../src/main/java/edu/slcc/asdv/bl/DBase.java | 4 +- .../asdv/bl/DatabaseManipulationParts.java | 8 +- .../asdv/bl/DatabaseManipulationSupplier.java | 8 +- 24 files changed, 1015 insertions(+), 3 deletions(-) create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase-5.zip create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/nb-configuration.xml create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/pom.xml create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/com/mycompany/supplierspartsdatabase/JakartaRestConfiguration.java create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/com/mycompany/supplierspartsdatabase/resources/JakartaEE9Resource.java create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/beans/SupplierBean.java create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/DBase.java create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/UtilitiesDatabase.java create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/part/DatabaseManipulationPart.java create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/part/Part.java create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/supplier/DatabaseManipulationSupplier.java create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/supplier/Supplier.java create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/resources/META-INF/persistence.xml create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/WEB-INF/beans.xml create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/WEB-INF/glassfish-web.xml create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/WEB-INF/web.xml create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/index.xhtml create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/resources/css/styles.css create mode 100644 Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/supplier.xhtml diff --git a/.gitignore b/.gitignore index cc1a6d6..88d7799 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ /Semester 2/Assignments/MP5-Binary-Files_CalebFontenot/nbproject/private/ /Semester 2/Assignments/MP5-Binary-Files_CalebFontenot/build/ /Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/target/ +/Semester 2/Assignments/SuppliersPartsDatabase/target/ diff --git a/Semester 2/Assignments/SuppliersPartsDatabase-5.zip b/Semester 2/Assignments/SuppliersPartsDatabase-5.zip new file mode 100644 index 0000000000000000000000000000000000000000..1d63129d84f27d7448d8a097450b0da1907ca49a GIT binary patch literal 17991 zcmcIrWk8lo)26$-LrOZOySuv|x;rHW0g-O$?(PN=X$7S_q(MNC5JCCCIK+F-c|D%@ z+vm^o=e}llc6MfG=303vP%s!EASfUpYeg+Jpc@18^1qU^ot>4rv4f*Lz`@B;7~ljj z05}@c%U^zk1_T8K1%#-keCs3Xzy8R^fY#8~#>Cvz*#Y2WZfis5W^I+LEMq&$fYiFK z2Im1%C{fq?A#+ESsNf~I{e2?YF)MC~S<+3el+g{a6^B??Ru0a}qe?DhlPIu?)>nlffYw{XE-tKz zXke(d9=?$jd5#X8d+aONs~iAB;MB2U1eF6|>(CcgUJ;_1MIA%to?`Pd_eZa7Ss z%B12@Oa$EVJX}8yoE>Wpm?{pCwO;$YrXmt@G;0x5tkfQiiInJ&7vY2*Lq{AxgvcG% z^qITd>(by%D(~JmA3+fp*Me$FNaQ$EeAz$+aGja=Xgi%ILoxk;^I0VO1Rw~k@M`X( zS0m(Q3zt*%JG_le)N&B0VtpTTyk5);c2-u_V_(7&pc7rlR90MD4mle`7eSl*-1lhH zqPyv2V;hpGQeuQk&Mm3B^L%;!aWc{c(hReHDaC*~OU*g`JI*dlyKCPmR zPv-Ynp2b!x@m6nuuEGqhri7Ao#297wnU2G$NE!?d0y7mpkaQX8Ut?{>CYnZrGU2Iu zDx@qhjm?Dp{^LqYfICqYVj7biB0UG9wQ}&;-novf?n4Pzc82NVBDZo141X11fzr|U zijuEib=k3|pdCIto~;bwP!p|IH7kvV-~D7aRUJHNFNzQvp=#4>1uB~)@RlHf|i+0Ak0*X;w;xOt0f4t>P?b*ckgSVTXFA8`- z&LP`HbZV-a_N}*+3YwqbThmt(i*#HB^rEJI3@eG)UmY^|a_G8`DK7;HB}wrx(;Nf{ zNEaLk=-PtqIB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d1E?^KepzAkXH{Z%!z3I9h ze{+og?1h)S)HU$cQ=6MF0Ir_eT#u7Wh5p6temuOn!uq+=yXv}nGjKf~Li{Dx_ZI}$ zKzFM{MAs;n|Em8U=*NqKYqYyW+^b!@9{az5_8)tCcY;?G;p@S2S%dovtzE73+XTNs zet&UrJ=43eS7o;A;qgykZ@xhIYXOqi=$HRq{holIk-_oqi-c<{yIR;yD!u6~xh$7A zv0v8L^}_x_?%%#pxM{9;wSC3nza9yfe&l~Qsp}iq&BJ#!gPR=mD^~yYfWGt}{~t5> z3y%Ly)!aQYx9!^*_7^Aioe+O*es^K7DDl^$<)6U*Ajn^1{~1O88XF4kA58fh_7B4R zwSYgP%wG%8_&ovNneI1j;)+6llLdVHh*ta?F+Yvz4?_LTE&nr)@%8c`FPmXMKfe>E zZo9NQME)zr@wFSc;vC;($nswcxcsN}+cK^h$Ty{3v2Jft_pVxY*P{pdcUSc19Ne3_ zyi3Npq6S`%6!hPf{DUZXtYltoDlMa~HjpA!G;rT>TIpVzy)@sjG69{5TByX4zZ@UL)h-+G?>BiuhagEv)nHSwEG zG{IXFpZYxkcUq4(t@F=XbJrqq$^W~ee$;Jlg5K>QUA5}2hyJgF{;aa!)zHnx)m7{6 zdX)Zi@IM-PH>F%H;bzl-|60W5zdnjz*2~W&{6|adrnIX@M8J)j^;IL{dQ@Lp?@vqr ztAO_BZHb#QuBzWR>xoy@@9U98^UE@B)WWaue;$pyHNUH>Z)paJ>VFAV+FTsm^ZiMs=Rfx4sd%t@|U~wi|TUx5eL2( zyKe5t-5i(bdNG&(1TH21jffxRh3oyji*`FT_4x&~AE_z$WfltrM0xqMy}U)e__px> E1F<4(X#fBK literal 0 HcmV?d00001 diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/nb-configuration.xml b/Semester 2/Assignments/SuppliersPartsDatabase/nb-configuration.xml new file mode 100644 index 0000000..f29f292 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/nb-configuration.xml @@ -0,0 +1,21 @@ + + + + + + 9.0-web + gfv700ee10 + Facelets + JDK_11__System_ + + diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/pom.xml b/Semester 2/Assignments/SuppliersPartsDatabase/pom.xml new file mode 100644 index 0000000..2dbcc06 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/pom.xml @@ -0,0 +1,88 @@ + + 4.0.0 + com.mycompany + SuppliersPartsDatabase + 1.0-SNAPSHOT + war + SuppliersPartsDatabase-1.0-SNAPSHOT + + + 1.8 + 1.8 + ${project.build.directory}/endorsed + UTF-8 + false + 9.0.0 + + + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + provided + + + com.mysql + mysql-connector-j + 8.1.0 + + + org.primefaces + primefaces + 12.0.0 + jakarta + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.8 + 1.8 + + ${endorsed.dir} + + + + + org.apache.maven.plugins + maven-war-plugin + 2.3 + + false + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.6 + + + validate + + copy + + + ${endorsed.dir} + true + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + jar + + + + + + + + + \ No newline at end of file diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/com/mycompany/supplierspartsdatabase/JakartaRestConfiguration.java b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/com/mycompany/supplierspartsdatabase/JakartaRestConfiguration.java new file mode 100644 index 0000000..110a745 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/com/mycompany/supplierspartsdatabase/JakartaRestConfiguration.java @@ -0,0 +1,13 @@ +package com.mycompany.supplierspartsdatabase; + +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +/** + * Configures Jakarta RESTful Web Services for the application. + * @author Juneau + */ +@ApplicationPath("resources") +public class JakartaRestConfiguration extends Application { + +} diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/com/mycompany/supplierspartsdatabase/resources/JakartaEE9Resource.java b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/com/mycompany/supplierspartsdatabase/resources/JakartaEE9Resource.java new file mode 100644 index 0000000..f7f850d --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/com/mycompany/supplierspartsdatabase/resources/JakartaEE9Resource.java @@ -0,0 +1,20 @@ +package com.mycompany.supplierspartsdatabase.resources; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; + +/** + * + * @author + */ +@Path("jakartaee9") +public class JakartaEE9Resource { + + @GET + public Response ping(){ + return Response + .ok("ping Jakarta EE") + .build(); + } +} diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/beans/SupplierBean.java b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/beans/SupplierBean.java new file mode 100644 index 0000000..bb36e46 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/beans/SupplierBean.java @@ -0,0 +1,68 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.beans; + +import edu.slcc.asdv.bl.DBase; +import edu.slcc.asdv.bl.supplier.DatabaseManipulationSupplier; +import edu.slcc.asdv.bl.supplier.Supplier; +import jakarta.inject.Named; +import jakarta.enterprise.context.SessionScoped; +import jakarta.faces.application.FacesMessage; +import jakarta.faces.application.FacesMessage.Severity; +import jakarta.faces.context.FacesContext; +import java.io.Serializable; +import java.util.List; + +@Named(value = "supplierBean") +@SessionScoped +public class SupplierBean implements Serializable +{ + DBase dms = new DatabaseManipulationSupplier(); + List suppliers; + + public SupplierBean() + { + suppliers = dms.listAll(); + } + + public List getSuppliers() + { + return suppliers; + } + + public void saveFromUpdate() + { + int totalRowsUpdated = 0; + for (Supplier s : this.suppliers) + { + if (s.isModify()) + { + try + { + int rowsUpdated = this.dms.update(s); + if (rowsUpdated > 0) + { + totalRowsUpdated += rowsUpdated; + s.setModify(false); + } + } + catch (Exception e) + { + String msg = ("Numbers of rows updated is 0."); + addMessage(msg, e.getMessage(), FacesMessage.SEVERITY_ERROR); + break; + } + } + } + String msg = ("Numbers of rows updated: " + totalRowsUpdated); + addMessage(msg, "no exception", FacesMessage.SEVERITY_INFO); + } + + public void addMessage(String summary, String detail, Severity severity) + { + FacesMessage msg = new FacesMessage(severity, summary, detail); + FacesContext.getCurrentInstance().addMessage(null, msg); + } +} diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/DBase.java b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/DBase.java new file mode 100644 index 0000000..320a494 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/DBase.java @@ -0,0 +1,22 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.bl; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author asdv5 + */ +public interface DBase +{ + List listAll(); + + int update( T t) + throws SQLException; + +} diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/UtilitiesDatabase.java b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/UtilitiesDatabase.java new file mode 100644 index 0000000..dad35b6 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/UtilitiesDatabase.java @@ -0,0 +1,96 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.bl; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.text.ParseException; +import java.text.SimpleDateFormat; + +/** + * + * @author asdv5 + */ +public class UtilitiesDatabase +{ + public Connection connection( + String databaseName, + String userName, + String password, + String URL2 + + ) //throws InstantiationException, IllegalAccessException + { +/* + String databaseName = "suppliers_parts_23"; + String userName = "root"; + String password = "root"; + String URL2 = "com.mysql.jdbc.Driver"; + Connection con = null; +*/ + Connection con; + try + {// Load Sun's jdbc driver + Class.forName(URL2).newInstance(); + System.out.println("JDBC Driver loaded!"); + } + catch (Exception e) // driver not found + { + System.err.println("Unable to load database driver"); + System.err.println("Details : " + e); + return null; + } + String ip = "localhost"; //internet connection + String url = "jdbc:mysql://" + ip + ":8889/" + databaseName + "?useSSL=false"; + try + { + con = DriverManager.getConnection(url, userName, password); + con.setReadOnly(false); + } + catch (Exception e) + { + System.err.println(e.toString()); + return null; + } + System.out.println("connection successfull"); + return con; + } + + + public void closeDatabaseConnection( Connection con) + { + try + { + if (con != null) + { + con.close(); + } + } + catch (SQLException e) + { + System.out.println(e); + e.printStackTrace(); + } + } + + + +public static java.sql.Date stringDateToSqlDate(String sDate) + { + java.util.Date date = null; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + try + { + date = sdf.parse(sDate); + } + catch (ParseException e) + { + e.printStackTrace(); + } + return new java.sql.Date( date.getTime() ); + + } +} diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/part/DatabaseManipulationPart.java b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/part/DatabaseManipulationPart.java new file mode 100644 index 0000000..c01a329 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/part/DatabaseManipulationPart.java @@ -0,0 +1,92 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.bl.part; + +import edu.slcc.asdv.bl.DBase; +import edu.slcc.asdv.bl.UtilitiesDatabase; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author asdv5 + */ +public class DatabaseManipulationPart implements DBase +{ + @Override + public List listAll() + { + List tableParts = new ArrayList(); + String databaseName = "suppliers_parts_23"; + String userName = "root"; + String password = "root"; + String URL2 = "com.mysql.jdbc.Driver"; + Connection con = new UtilitiesDatabase().connection( + databaseName, userName, password, URL2); + PreparedStatement ps = null; + try + { + if (con == null) + { + throw new RuntimeException("cannot connect to database"); + } + String table = ""; + ResultSet rs = null; + String sqlStr = "SELECT * FROM part"; + //prepare statement + ps = con.prepareStatement(sqlStr); + //execute + rs = ps.executeQuery(); + int row = 0; + while (rs.next()) + { + String pNumber = rs.getString(1); + String pName = rs.getString(2); + String color = rs.getString(3) + " "; + String city = rs.getString(4) + " "; + Part part = new Part(pNumber, pName, color, city); + tableParts.add(part); + row++; + } + } + catch (Exception ex) + { + ex.printStackTrace(); + } + finally + { + try + { + new UtilitiesDatabase().closeDatabaseConnection(con); + // close the resources + if (ps != null) + { + ps.close(); + } + } + catch (SQLException sqle) + { + sqle.printStackTrace(); + } + } + return tableParts; + } + + public static void main(String[] args) + { + DatabaseManipulationPart dmp = new DatabaseManipulationPart(); + System.out.println(dmp.listAll()); + } + + @Override + public int update(Part t) + { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } +} diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/part/Part.java b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/part/Part.java new file mode 100644 index 0000000..54bd19a --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/part/Part.java @@ -0,0 +1,75 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.bl.part; + +/** + * + * @author asdv5 + */ +public class Part +{ + private String pnumber; + private String pname; + private String color; + private String city; + + public Part(String pnumber, String pname, String color, String city) + { + this.pnumber = pnumber; + this.pname = pname; + this.color = color; + this.city = city; + } + + + public String getColor() + { + return color; + } + + public void setColor(String color) + { + this.color = color; + } + + public String getCity() + { + return city; + } + + public void setCity(String city) + { + this.city = city; + } + + public String getPname() + { + return pname; + } + + public void setPname(String pname) + { + this.pname = pname; + } + + public String getPnumber() + { + return pnumber; + } + + public void setPnumber(String pnumber) + { + this.pnumber = pnumber; + } + + @Override + public String toString() + { + return "Part{" + "pnumber=" + pnumber + ", pname=" + pname + ", color=" + color + ", city=" + city + '}'; + } + + + +} diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/supplier/DatabaseManipulationSupplier.java b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/supplier/DatabaseManipulationSupplier.java new file mode 100644 index 0000000..ccadfb2 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/supplier/DatabaseManipulationSupplier.java @@ -0,0 +1,140 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.bl.supplier; + +import edu.slcc.asdv.bl.DBase; +import edu.slcc.asdv.bl.UtilitiesDatabase; +import java.sql.Connection; +import java.sql.ParameterMetaData; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author asdv5 + */ +public class DatabaseManipulationSupplier implements DBase +{ + @Override + public List listAll() + { + List tableSuppliers = new ArrayList(); + String databaseName = "suppliers_parts_23"; + String userName = "root"; + String password = "root"; + String URL2 = "com.mysql.jdbc.Driver"; + Connection con = new UtilitiesDatabase().connection( + databaseName, userName, password, URL2); + PreparedStatement ps = null; + try + { + if (con == null) + { + throw new RuntimeException("cannot connect to database"); + } + String table = ""; + ResultSet rs = null; + String sqlStr = "SELECT * FROM supplier"; + //prepare statement + ps = con.prepareStatement(sqlStr); + //execute + rs = ps.executeQuery(); + int row = 0; + while (rs.next()) + { + String sNumber = rs.getString(1); + String sName = rs.getString(2); + String bdate = rs.getDate(3) + " "; + int status = rs.getInt(4); + String city = rs.getString(5) + " "; + Supplier supplier = new Supplier(sNumber, sName, bdate, status, city); + tableSuppliers.add(supplier); + row++; + } + } + catch (Exception ex) + { + ex.printStackTrace(); + } + finally + { + try + { + new UtilitiesDatabase().closeDatabaseConnection(con); + // close the resources + if (ps != null) + { + ps.close(); + } + } + catch (SQLException sqle) + { + sqle.printStackTrace(); + } + } + return tableSuppliers; + } + + @Override + public int update(Supplier t) + throws SQLException + { + String databaseName = "suppliers_parts_23"; + String userName = "root"; + String password = "root"; + String URL2 = "com.mysql.jdbc.Driver"; + Connection con = new UtilitiesDatabase().connection( + databaseName, userName, password, URL2); + int result = 0; + PreparedStatement updateSupplier = null; + try + { + if (con == null) + { + throw new RuntimeException("cannot connect to database"); + } + + + updateSupplier = con.prepareStatement( + "UPDATE supplier SET snumber=?, sname=?, status=?, birthday=?, city=? WHERE snumber=?"); + updateSupplier.setString(1, t.getSnumber()); + updateSupplier.setString(2, t.getSname()); + updateSupplier.setInt(3, t.getStatus()); + java.sql.Date bd = UtilitiesDatabase.stringDateToSqlDate(t.getBirthday()); + updateSupplier.setDate(4, bd); + updateSupplier.setString(5, t.getCity()); + updateSupplier.setString(6, t.getSnumber()); + result = updateSupplier.executeUpdate(); + } + catch (SQLException ex) + { + System.err.println(ex.toString()); + throw ex; + } + finally + { + try + { + new UtilitiesDatabase().closeDatabaseConnection(con); + // close the resources + if (updateSupplier != null) + { + updateSupplier.close(); + } + } + catch (SQLException sqle) + { + sqle.printStackTrace(); + throw sqle; + } + } + return result; + } + + +} diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/supplier/Supplier.java b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/supplier/Supplier.java new file mode 100644 index 0000000..a0c664b --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/java/edu/slcc/asdv/bl/supplier/Supplier.java @@ -0,0 +1,110 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.bl.supplier; + +import java.io.Serializable; + +/** + * + * @author asdv5 + */ +public class Supplier implements Serializable +{ + private String snumber; + private String sname; + private String birthday; + private int status; + private String city; + + private boolean modify; + + public boolean isModify() + { + return modify; + } + + public void setModify(boolean modify) + { + this.modify = modify; + } + + + public Supplier(String snumber, String sname, String birthday, int status, String city) + { + this.snumber = snumber; + this.sname = sname; + this.birthday = birthday; + this.status = status; + this.city = city; + this.modify = false; + } + + public String getCity() + { + return city; + } + + public void setCity(String city) + { + this.city = city; + } + + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + + + + + public String getBirthday() + { + return birthday; + } + + public void setBirthday(String birthday) + { + this.birthday = birthday; + } + + + public String getSname() + { + return sname; + } + + public void setSname(String sname) + { + System.out.println( sname); + this.sname = sname; + } + + + public String getSnumber() + { + + return snumber; + } + + public void setSnumber(String snumber) + { + this.snumber = snumber; + } + + @Override + public String toString() + { + return "Supplier{" + "snumber=" + snumber + ", sname=" + sname + ", birthday=" + birthday + ", status=" + status + ", city=" + city + '}'; + } + + + +} diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/resources/META-INF/persistence.xml b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..baad290 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/WEB-INF/beans.xml b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000..b3a1279 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/WEB-INF/glassfish-web.xml b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..584a477 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/WEB-INF/glassfish-web.xml @@ -0,0 +1,25 @@ + + + + + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/WEB-INF/web.xml b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..11562f0 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + jakarta.faces.PROJECT_STAGE + Development + + + Faces Servlet + jakarta.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/supplier.xhtml + + diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/index.xhtml b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/index.xhtml new file mode 100644 index 0000000..3220605 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/index.xhtml @@ -0,0 +1,51 @@ + + + + + + Supplier Parts DB + + + + +

Suppliers-Parts Database

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ \ No newline at end of file diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/resources/css/styles.css b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/resources/css/styles.css new file mode 100644 index 0000000..9d96af6 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/resources/css/styles.css @@ -0,0 +1,71 @@ +.body { + background: #eee; +} + +.button { + margin: 10px; + border-left: thin solid darkGray; + border-bottom: thin solid darkGray; + border-top: thin solid lightGray; + border-right: thin solid lightGray; + color: #777; + background: #A7C942; + font-family: "Comic Sans MS"; + border-radius: 20%; +} +h1 +{ + vertical-align: top; + text-align: middle; + font-style: italic; + color: #888; + font-size: 2em; + font-family: "Comic Sans MS"; + +} + +.label +{ + color: #888; + font-size: 0.8em; + font-family: "Comic Sans MS"; +} +.leftImage { + float: left; + margin-right: 1em; +} + +.backLink { + font-style: italic; +} + + +.tableHeader { + font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; + border-collapse:collapse; + font-size:1.1em; + text-align:left; + padding-top:5px; + padding-bottom:4px; + background-color:#A7C942; + color:white; + border:1px solid #98bf21; +} + +.oddTableRow { + border:1px solid #98bf21; +} + +.evenTableRow { + background-color: #eeeeee; + font-size:1em; + + padding:3px 7px 2px 7px; + + color:#000000; + background-color:#EAF2D3; +} + +.table { + border:1px solid green; +} \ No newline at end of file diff --git a/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/supplier.xhtml b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/supplier.xhtml new file mode 100644 index 0000000..027a095 --- /dev/null +++ b/Semester 2/Assignments/SuppliersPartsDatabase/src/main/webapp/supplier.xhtml @@ -0,0 +1,58 @@ + + + + + Facelet Title + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/pom.xml b/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/pom.xml index 7d7e0e5..85de6da 100644 --- a/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/pom.xml +++ b/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/pom.xml @@ -28,6 +28,16 @@ mysql-connector-j 8.1.0 + + org.primefaces + primefaces + 13.0.1 + + + jakarta.servlet + jakarta.servlet-api + 6.0.0 + diff --git a/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/src/main/java/edu/slcc/asdv/bl/DBase.java b/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/src/main/java/edu/slcc/asdv/bl/DBase.java index 9a4a6a3..3308858 100644 --- a/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/src/main/java/edu/slcc/asdv/bl/DBase.java +++ b/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/src/main/java/edu/slcc/asdv/bl/DBase.java @@ -4,6 +4,7 @@ */ package edu.slcc.asdv.bl; +import java.sql.SQLException; import java.util.ArrayList; import java.util.List; @@ -15,4 +16,5 @@ public interface DBase { List listAll(); -} + int update(T t) throws SQLException; + } diff --git a/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/src/main/java/edu/slcc/asdv/bl/DatabaseManipulationParts.java b/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/src/main/java/edu/slcc/asdv/bl/DatabaseManipulationParts.java index 23232b8..8c39ad3 100644 --- a/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/src/main/java/edu/slcc/asdv/bl/DatabaseManipulationParts.java +++ b/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/src/main/java/edu/slcc/asdv/bl/DatabaseManipulationParts.java @@ -56,7 +56,7 @@ public class DatabaseManipulationParts implements DBase row++; } } - catch (Exception ex) + catch (SQLException ex) { ex.printStackTrace(); } @@ -82,4 +82,10 @@ public class DatabaseManipulationParts implements DBase DatabaseManipulationParts dms = new DatabaseManipulationParts(); System.out.println( dms.listAll()); } + + @Override + public int update(Part t) throws SQLException + { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } } diff --git a/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/src/main/java/edu/slcc/asdv/bl/DatabaseManipulationSupplier.java b/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/src/main/java/edu/slcc/asdv/bl/DatabaseManipulationSupplier.java index 4e228eb..3885dca 100644 --- a/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/src/main/java/edu/slcc/asdv/bl/DatabaseManipulationSupplier.java +++ b/Semester 2/Assignments/SuppliersPartsDatabase_CalebFontenot/src/main/java/edu/slcc/asdv/bl/DatabaseManipulationSupplier.java @@ -57,7 +57,7 @@ public class DatabaseManipulationSupplier implements DBase row++; } } - catch (Exception ex) + catch (SQLException ex) { ex.printStackTrace(); } @@ -83,4 +83,10 @@ public class DatabaseManipulationSupplier implements DBase DatabaseManipulationSupplier dms = new DatabaseManipulationSupplier(); System.out.println( dms.listAll()); } + + @Override + public int update(Supplier t) throws SQLException + { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } }