⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 db_form.xtp

📁 解压在c盘
💻 XTP
字号:
<s1 title="Database"><p>Resin provides a interface to database pooling followingJDBC.  Database pools are named, identifying a configuration.  TheJSP or Bean can be written independent of the database vendor or driver.</p><example title='Storing a Survey in a Database'>&lt;%@ page language=java %&gt;&lt;%@ page import='java.sql.*' %&gt;&lt;%@ page import='javax.sql.*' %&gt;&lt;%@ page import='javax.naming.*' %&gt;&lt;%Context env = (Context) new InitialContext().lookup("java:comp/env");DataSource source = (DataSource) env.lookup("jdbc/test_db");Connection conn = source.getConnection();try {  Statement stmt = conn.createStatement();  String name = request.getParameter("name");  String color = request.getParameter("color");  stmt.executeUpdate(    "insert into COLORS values (" +    "'" + name + "', '" + color + "')"  );} finally {  conn.close();}%&gt;&lt;h1&gt;Thank you, &lt;%= name %&gt;&lt;/h1&gt;</example><p><code/DataSource/> is the standard Java API for obtaining newdatabase connections.<p>Closing the connection automatically returns it to the database pool.It is very important that you use the <var/try ... finally/> pattern tomake sure the connections get returned to the pool.</s1>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -