test
jdbc/sqlite
javax.sql.DataSource
Container
<%@ page language="java" contentType="text/html; charset=Shift_JIS" pageEncoding="Shift_JIS"%><%@ page import="java.sql.*,javax.naming.*,javax.sql.*,java.util.*,java.text.*,java.net.*" %>
<%
InitialContext ic = new InitialContext();
DataSource ds=(DataSource)ic.lookup("java:comp/env/jdbc/sqlite");
Connection conn=ds.getConnection();
PreparedStatement ps=conn.prepareStatement("select datetime('now','localtime')");
ps.execute();
ResultSet rs=ps.getResultSet();
while(rs.next()){
out.println(rs.getString(1));
}
%>
2013-04-18 17:01:20