◆Sakaj.xml
<Context path="/Sakaj" reloadable="true" docBase="D:\Eclipse\eclipse\workspace\Sakaj" workDir="D:\Eclipse\eclipse\workspace\Sakaj\work" >
<Resource
name="jdbc/PostgreSql"
auth="Container"
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/[dbname]"
username="user"
password="pass"
maxActive="100"
maxIdle="0"
maxWait="2000"
removeAbandoned="true"
removeAbandonedTimeout="5"
logAbandoned="false"
/>
<!--
-->
</Context>
◆WEB-INF/web.xml
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/PostgreSql</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
◆JSP
<%@ page import="java.sql.*" %>
<%@ page import="javax.sql.*" %>
<%@ page import="javax.naming.*" %>
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup("java:comp/env/jdbc/PostgreSql");
Connection c = ds.getConnection();
Statement st = c.createStatement();
ResultSet rs = st.executeQuery( Sql );
急上昇Wikiランキング
急上昇中のWikiランキングです。今注目を集めている話題をチェックしてみよう!
最近作成されたWikiのアクセスランキングです。見るだけでなく加筆してみよう!
atwikiでよく見られているWikiのランキングです。新しい情報を発見してみよう!
最近アクセスの多かったページランキングです。話題のページを見に行こう!