~ moved HelloWorld Servlet

~ asserted connection to database

Signed-off-by: Johannes Theiner <j.theiner@live.de>
This commit is contained in:
Johannes Theiner 2019-04-08 18:30:46 +02:00
parent 7495f455e2
commit 49287ee2e4
3 changed files with 3 additions and 3 deletions

View File

@ -35,8 +35,8 @@ public class Database {
String hello = "";
try {
assert connection != null;
PreparedStatement statement = connection.prepareStatement("SELECT * FROM test WHERE id = 1");
ResultSet resultSet = statement.executeQuery();
resultSet.next();
hello = resultSet.getString("hello");

View File

@ -1,4 +1,4 @@
package de.hsel.itech;
package de.hsel.itech.servlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

View File

@ -7,7 +7,7 @@
<web-app>
<servlet>
<servlet-name>helloWorld</servlet-name>
<servlet-class>de.hsel.itech.HelloWorld</servlet-class>
<servlet-class>de.hsel.itech.servlet.HelloWorld</servlet-class>
</servlet>
<servlet>