~ moved HelloWorld Servlet
~ asserted connection to database Signed-off-by: Johannes Theiner <j.theiner@live.de>
This commit is contained in:
parent
7495f455e2
commit
49287ee2e4
|
@ -35,8 +35,8 @@ public class Database {
|
||||||
|
|
||||||
String hello = "";
|
String hello = "";
|
||||||
try {
|
try {
|
||||||
|
assert connection != null;
|
||||||
PreparedStatement statement = connection.prepareStatement("SELECT * FROM test WHERE id = 1");
|
PreparedStatement statement = connection.prepareStatement("SELECT * FROM test WHERE id = 1");
|
||||||
|
|
||||||
ResultSet resultSet = statement.executeQuery();
|
ResultSet resultSet = statement.executeQuery();
|
||||||
resultSet.next();
|
resultSet.next();
|
||||||
hello = resultSet.getString("hello");
|
hello = resultSet.getString("hello");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package de.hsel.itech;
|
package de.hsel.itech.servlet;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServlet;
|
import javax.servlet.http.HttpServlet;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
|
@ -7,7 +7,7 @@
|
||||||
<web-app>
|
<web-app>
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>helloWorld</servlet-name>
|
<servlet-name>helloWorld</servlet-name>
|
||||||
<servlet-class>de.hsel.itech.HelloWorld</servlet-class>
|
<servlet-class>de.hsel.itech.servlet.HelloWorld</servlet-class>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
<servlet>
|
<servlet>
|
||||||
|
|
Loading…
Reference in New Issue