易截截图软件、单文件、免安装、纯绿色、仅160KB

JSP数据库连接疑问(Mysql)

package com.wxpn.tutorial.db;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
import java.util.Date;
/**
 * 描述: 数据库连接池类
 * 
 * 
 * @version 1.0
 */
public class ConnectionPool implements Runnable {
 private boolean _debug = false;
 private Thread runner;
 private Connection[] connPool;
 private int[] connStatus; // (0) available; (1) locked by the client; (2)
 // locked by the housekeeping thread
 private long[] connLockTime;
 private long[] connCreateTime;
 private String[] connID;
 private String dbdriver, dbserver, dbuser, dbpassword;
 private int currConnections, connLast, minconns, maxconns, maxconnMSec;
 // available: set to false on destroy, checked by getConnection()
 private boolean available = true;
 private SQLWarning currSQLWarning;
 /**
  * Creates a new Connection Broker<br>
  *
  * @param dbdriver
  *            JDBC driver. e.g. 'oracle.jdbc.driver.OracleDriver'<br>
  * @param dbserver
  *            JDBC connect string. e.g.
  *            'jdbc:oracle:thin:@203.92.21.109:1526:orcl'<br>
  * @param dbuser
  *            Database login name. e.g. 'Scott'<br>
  * @param dbpassword
  *            Database password. e.g. 'Tiger'<br>
  * @param minconns
  *            Minimum number of connections to start with.<br>
  * @param maxconns
  * &


相关文档:

将日志文件写入MySqL中

首先建一个工程,准备好一个log4j的jar包和连接MySqL的驱动包。配置如下:
修改log4j.properties文件:
######## #此句为定义名为stdout的输出端是哪种类型,可以是
#org.apache.log4j.ConsoleAppender(控制台),
#org.apache.log4j.FileAppender(文件),
#org.apache.log4j.DailyRollingFileAppender(每天产生一 ......

JSP/Servlet的编码原理


JSP/Servlet的编码原理
关键字: jsp, servlet编码
首先,说说 JSP/Servlet 中的几个编码的作用 
在 JSP/Servlet 中主要有以下几种设置编码的方式:
pageEncoding ="UTF-8"
contentType = "text/html;charset=UTF-8"
request.setCharacterEncoding("UTF-8")
response.setCharacterEncodin ......

oracle和mysql日期函数对比

MySQL日期字段分Date和Time两种,oracle日期字段只有Date,包含年月日时分秒信息,用当前数据库的系统时间为sysdate,精确到秒,或者用字符串转换日期型函数:
 
    To_date('2001-08-01','YYYY-MM-DD'); 年-月-日
    24小时:分钟:秒的格式  'YYYY-MM-DD HH24:MI:SS'  ......

MySQL不支持INTERSECT和MINUS,及其替代方法

Doing INTERSECT and MINUS in MySQL
By Carsten | October 3, 2005
Doing an INTERSECT
An INTERSECT is simply an inner join where we compare the tuples of one table with those of the other, and select those that appear in both while weeding out duplicates. So
SELECT member_id, name from a
INTERSECT ......

JSP中可能会碰到的问题解答

JSP中可能会碰到的问题解答
来源:不详 作者:佚名 更新时间: 2009年07月02日 点击:
JSP中可能会碰到的问题解答 
1、如何混合使用Jsp和SSI #include?
在JSP中可以使用如下方式包含纯HTML:
< !--#include file="data.inc"-- >
但是如果data.inc中包含JSP CODE ,我们可以使用:
< %@include file= ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号