Folgen Sie dem Video unten, um zu sehen, wie Sie unsere Website als Icon auf Ihrem Homescreen erstellen.
Anmerkung: This feature may not be available in some browsers.
Da hast du recht. ich habs z.B. zu Fuss auf AS400 und bzw auf nem pc gelernt. Ohne Netbeans, ohne ant, ohne tomcat (mit einem Texteditor, javac, servlet express bzw später websphere).ja das schrieb ich weiter oben auch schon. Wenn er das haben mag, soll er Netbeans nehmen, da geht es mit registrierten und brav zum Projekt hinzugefügten Libraries
Für mich war es aber zum lernen besser zu wissen was da alles von wo nach wo mußte. Diese Automatismen sind toll für eine schnelle Lernbelohnung, der Fußweg ist aber der lehrreichere meine ich.
yo...zwar wird extreme programming bei uns an der FH zwar propagiert, aber an der umsetzung hapert's...vor allem, wenn der teampartner sich ohne bescheidzugeben einfach verpisst...
Ach, das waren noch Zeiten, obwohl mit einem 24-Nadeldrucker ging es auch nicht schneller, eher im Gegenteil...( 100 Seiten Listingdruck mit einem 9-Nadeldrucker ).
public class DBConnMgrServlet extends HttpServlet {
/**
* standardkrempel...brauch man das?
*/
private static final long serialVersionUID = 1L;
final static String host = "localhost";
final static String userid = "root";
final static String passwd = "geheim";
final static String dbname = "myclicker";
final static String port = "3306";
static String connStr = "jdbc:mysql://"+ host + ":" + port + "/" + dbname;
PreparedStatement pstmt = null;
String selectString = "SELECT shortname FROM fragestellung WHERE aktiv=?";
String insertString = "INSERT INTO metadaten_http VALUES (?,?)";
int id = 1;
String ipaddr = "192.168.10.2";
public DBConnMgrServlet() {
super();
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
Connection conn=null;
PrintWriter out = resp.getWriter();
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection(connStr, userid, passwd);
out.println("Verbindung zu \t" + dbname + "\t hergestellt!");
pstmt = conn.prepareStatement(insertString);
pstmt.setInt(1, id);
pstmt.setString(2, ipaddr);
pstmt.executeUpdate();
out.println("insert erfolgreich");
} catch (InstantiationException e) {
e.printStackTrace();
out.println("Error! Instantiation failed!\n" + e);
} catch (IllegalAccessException e) {
e.printStackTrace();
out.println("Error! Illegal Access on DataBase: " + dbname +"\n" + e);
} catch (ClassNotFoundException e) {
e.printStackTrace();
out.println("Error! Class not found!\n" + e);
} catch (SQLException e) {
e.printStackTrace();
out.println("Error! SQL Exception!\t" + e + " SQLState:\t " + e.getSQLState());
}
}
}
Error! SQL Exception!
java.sql.SQLException: null, message from server: "Host '192.168.2.102' is not allowed to connect to this MySQL server"
SQLState: HY000
Host '192.168.2.102' is not allowed to connect to this MySQL server
package org.fhffm.servlet;
...
/**
*
* @author naphaneal
*
*/
public class DBConnMgrServlet extends HttpServlet {
...
final static String host = "localhost";
final static String userid = "root";
final static String passwd = "geheim";
final static String dbname = "myclicker";
final static String port = "3306";
static String connStr = "jdbc:mysql://"+ host + ":" + port + "/" + dbname;
PreparedStatement pstmt = null;
String selectString = "SELECT shortname FROM fragestellung WHERE aktiv=?";
String insertString = "INSERT INTO metadata_http VALUES (?,?,?)";
int id = 1;
String ipaddr = "192.168.10.2";
...
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
Connection conn=null;
PrintWriter out = resp.getWriter();
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection(connStr, userid, passwd);
out.println("Verbindung zu \t" + dbname + "\t hergestellt!");
pstmt = conn.prepareStatement(insertString);
pstmt.setInt(1, id);
pstmt.setString(2, ipaddr);
pstmt.executeUpdate();
out.println("insert erfolgreich");
}...
}
aber ich glaub mein statement ist nicht richtig...
Error! SQL Exception!
java.sql.SQLException: null, message from server: "Host '192.168.2.102' is not allowed to connect to this MySQL server"
SQLState: HY000