{"id":4110,"date":"2018-03-07T09:51:27","date_gmt":"2018-03-07T08:51:27","guid":{"rendered":"http:\/\/liceocuneo.it\/oddenino\/?p=4110"},"modified":"2018-03-14T09:44:26","modified_gmt":"2018-03-14T08:44:26","slug":"prototipo-di-pagina-jsp-per-laccesso-ad-un-db","status":"publish","type":"post","link":"https:\/\/liceocuneo.it\/oddenino\/prototipo-di-pagina-jsp-per-laccesso-ad-un-db\/","title":{"rendered":"Prototipo di pagina JSP per l&#8217;accesso ad un DB"},"content":{"rendered":"<p>Tabella: Classe5E<\/p>\n<p><strong>index.html<\/strong><\/p>\n<ul>\n<li>Crea la tabella<\/li>\n<li>Cancella la tabella<\/li>\n<li>Inserisci un nominativo<\/li>\n<li>Cancella un nominativo<\/li>\n<li>Visualizza tutti i nominativi<\/li>\n<\/ul>\n<p><strong>crea.jsp<\/strong><\/p>\n<pre>&lt;%@page import=\"java.sql.DriverManager\"%&gt;\r\n&lt;%@page import=\"java.sql.Connection\"%&gt;\r\n&lt;%@page import=\"java.sql.Statement\"%&gt;\r\n&lt;%@page import=\"java.sql.ResultSet\"%&gt;\r\n&lt;%@page import=\"java.sql.SQLException\"%&gt;\r\n&lt;%@page contentType=\"text\/html\" pageEncoding=\"UTF-8\"%&gt;\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=UTF-8\"&gt;\r\n    &lt;title&gt;Classe 5\u00aa E&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;h1&gt;Classe 5\u00aa E - Creazione tabella&lt;\/h1&gt;\r\n    &lt;%\r\n        try {\r\n            Class.forName(\"com.mysql.jdbc.Driver\").newInstance();\r\n            Connection conn = DriverManager.getConnection(\"jdbc:mysql:\/\/didattica1.liceocuneo.it\/db1\", \"studente1\", \"topolino13\");\r\n            Statement stat = conn.createStatement();\r\n            stat.executeUpdate(\"CREATE TABLE Classe5E (ID_Studente INT NOT NULL AUTO_INCREMENT, Cognome VARCHAR(45) NOT NULL, Nome VARCHAR(45) NOT NULL, LuogoNascita VARCHAR(45) NOT NULL, DataNascita DATE NOT NULL, PRIMARY KEY (ID_Studente))\");\r\n            stat.close();\r\n            conn.close();\r\n    %&gt;\r\n    &lt;p&gt;Tabella \"Classe5E\" creata correttamente.&lt;\/p&gt;\r\n    &lt;%\r\n        } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | SQLException ex) {\r\n    %&gt;\r\n    &lt;p&gt;&lt;%=ex.toString()%&gt;&lt;br\/&gt;&lt;%=ex.getMessage()%&gt;&lt;\/p&gt;\r\n    &lt;%\r\n        } \/\/ endcatch\r\n    %&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>Progetto NetBeans completo: <a href=\"https:\/\/liceocuneo.it\/oddenino\/wp-content\/uploads\/sites\/2\/Anagrafe5E.zip\">Anagrafe5E.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tabella: Classe5E index.html Crea la tabella Cancella la tabella Inserisci un nominativo Cancella un nominativo Visualizza tutti i nominativi crea.jsp &lt;%@page import=&#8221;java.sql.DriverManager&#8221;%&gt; &lt;%@page import=&#8221;java.sql.Connection&#8221;%&gt; &lt;%@page import=&#8221;java.sql.Statement&#8221;%&gt; &lt;%@page import=&#8221;java.sql.ResultSet&#8221;%&gt; &lt;%@page import=&#8221;java.sql.SQLException&#8221;%&gt; &lt;%@page contentType=&#8221;text\/html&#8221; pageEncoding=&#8221;UTF-8&#8243;%&gt; &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text\/html; charset=UTF-8&#8243;&gt; &lt;title&gt;Classe 5\u00aa E&lt;\/title&gt; &lt;\/head&gt; &lt;body&gt; &lt;h1&gt;Classe 5\u00aa E &#8211; Creazione tabella&lt;\/h1&gt; &lt;% try { &hellip; <a href=\"https:\/\/liceocuneo.it\/oddenino\/prototipo-di-pagina-jsp-per-laccesso-ad-un-db\/\" class=\"more-link\">Continua a leggere <span class=\"screen-reader-text\">Prototipo di pagina JSP per l&#8217;accesso ad un DB<\/span><\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-4110","post","type-post","status-publish","format-standard","hentry","category-informatica"],"_links":{"self":[{"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/posts\/4110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/comments?post=4110"}],"version-history":[{"count":0,"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/posts\/4110\/revisions"}],"wp:attachment":[{"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/media?parent=4110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/categories?post=4110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/tags?post=4110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}