hailor @hailor ?

active 11 months ago
  • hailor 撰写了一篇新 Blog 日志:学习与使用Spring Security2(一)

    Spring Security2是一套安全验证框架,与它的前一个版本acegi相比,简化了很多配置的工作,因为很多配置都已经自动完成了。下面就开始体验一下Spring Security2配置的简单与强大。在本文中将介绍Spring Security2的基本使用。 1, 新建一个J2EE Web工程。 2, 添加必须的jar包放到classpath中: spring.jar spring-security-core-2.0.4.jar spring-security-core-tiger-2.0.4.jar 3, 添加Spring Security的配置文件。在WEB-INF目录下建Application-Security.xml文件。并加入以下配置信息。 <?xml version=”1.0″ encoding=”UTF-8″?> <beans:beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance              xmlns=http://www.springframework.org/schema/security              xmlns:beans=http://www.springframework.org/schema/beans              xsi:schemalocation=”http://www.springframework.org/schema/beans              http://www.springframework.org/schema/beans/spring-beans-2.5.xsd            &nbsp; http://www.springframework.org/schema/security            &nbsp; http://www.springframework.org/schema/security/spring-security-2.0.4.xsd”&gt;                                             &nbsp;    <http auto-config=”true”>                                        <intercept-url access=”ROLE_USER” pattern=”/**” />                            </http>                                                <authentication-provider>                                    <user-service>                                            <user authorities=”ROLE_USER, ROLE_ADMIN” password=”hand” name=”hand” />                                            <user [...]

      1 year, 1 month ago · View

  • hailor 撰写了一篇新 Blog 日志:Oracle JDBC无法取得时分秒

    在项目中使用的Oracle JDBC版本为Oracle JDBC Driver version – 9.0.2.0.0,由于使用了Hibernate,所以一直没有发现使用native sql查询时时间类型会丢失时分秒。测试程序如下:
    public class TestDate {
    public static void main(String[] args) {
    Connection connection = null;
    try {
    Class.forName(”oracle.jdbc.driver.OracleDriver”);
    try {
    connection = DriverManager.getConnection(”jdbc:oracle:thin:@localhost:1521:xe”,”exthosf”,”exthosf”);
    PreparedStatement ps=connection.prepareStatement(”SELECT sysdate FROM dual”);
    ResultSet rs=ps.executeQuery();
    while(rs.next())
    System.out.println(rs.getObject(1));
    } catch (SQLException e) {
    e.printStackTrace();
    }
    if (connection != null) {
    System.out.println(”取得连接 :) ”);
    } else {
    System.out.println(”无法取得数据库连接!”);
    }
    } catch (ClassNotFoundException e) [...]

      1 year, 1 month ago · View

  • hailorDerek.Jaa 已经成为好友   1 year, 2 months ago · View

  • aronezhanghailor 已经成为好友   1 year, 2 months ago · View

  • hailorEleven.Xu 已经成为好友   1 year, 2 months ago · View