Commit b51ca9c7 by Patryk Czarnik

Operacja wszystkieProdukty

parent bfeb1e6b
...@@ -27,6 +27,12 @@ ...@@ -27,6 +27,12 @@
<version>4.0.0</version> <version>4.0.0</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.6.0</version>
<scope>runtime</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package sklep.soap; package sklep.soap;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
import jakarta.jws.WebParam; import jakarta.jws.WebParam;
import jakarta.jws.WebResult; import jakarta.jws.WebResult;
import jakarta.jws.WebService; import jakarta.jws.WebService;
import sklep.db.DBConnection;
import sklep.db.DBException;
import sklep.db.ProductDAO;
import sklep.model.Product;
@WebService @WebService
public class Sklep { public class Sklep {
...@@ -34,4 +39,11 @@ public class Sklep { ...@@ -34,4 +39,11 @@ public class Sklep {
}; };
} }
public List<Product> wszystkieProdukty() throws DBException {
try(DBConnection db = DBConnection.open()) {
ProductDAO productDAO = db.productDAO();
return productDAO.readAll();
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment