Commit ad1aea5f by Patryk Czarnik

Usługa Sklep - pierwsza metoda

parent 7b745c8a
...@@ -44,5 +44,11 @@ ...@@ -44,5 +44,11 @@
<artifactId>jaxb-api</artifactId> <artifactId>jaxb-api</artifactId>
<version>2.3.1</version> <version>2.3.1</version>
</dependency> </dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.5.0</version>
<scope>runtime</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
package sklep.soap;
import java.util.List;
import javax.jws.WebService;
import sklep.db.DBConnection;
import sklep.db.DBException;
import sklep.db.ProductDAO;
import sklep.model.Product;
@WebService
public class Sklep {
public List<Product> odczytajWszystkieProdukty() 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