lxt008

 

2008年5月6日

我的视频课程"Servlet与JSP核心技术"被盗版!!!

http://www.chinacode.cn/Training/VideoList.aspx?CurrentPage=3

posted @ 2008-05-06 16:41 江南散人 阅读(198) | 评论 (0)编辑 收藏

"UML核心技术"我的视频课程被新浪盗版!!!哈哈!!

http://you.video.sina.com.cn/b/10288517-1281081403.html

http://you.video.sina.com.cn/b/10289247-1281081403.html

posted @ 2008-05-06 16:35 江南散人 阅读(271) | 评论 (1)编辑 收藏

我的视频课程"Java基础课程"被优酷视频盗版!!!

http://www.youku.com/playlist_show/id_761704.html

posted @ 2008-05-06 16:05 江南散人 阅读(169) | 评论 (0)编辑 收藏

我的视频课程_Linux+C,,被优酷视频盗版!!!

http://www.youku.com/playlist_show/id_1484099_orderby_9_page_2.html

posted @ 2008-05-06 15:53 江南散人 阅读(176) | 评论 (0)编辑 收藏

2008年5月5日

使用Spring给类注入集合

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
   
    <!-- oracle bean used for a few examples -->
    <bean id="oracle" name="wiseworm" class="BookwormOracle"/>

    <!-- collection injection samples -->
    <bean id="injectCollection" class="CollectionInjection">
        <property name="map">
            <map>
                <entry key="someValue">
                    <value>Hello World!</value>
                </entry>
                <entry key="someBean">
                    <ref local="oracle"/>
                </entry>
            </map>
        </property>
        <property name="props">
            <props>
                <prop key="firstName"> Rob </prop>
                <prop key="secondName"> Harrop </prop>
            </props>
        </property>
        <property name="set">
            <set>
                <value>Hello World!</value>
                <ref local="oracle"/>
            </set>
        </property>
        <property name="list">
            <list>
                <value>Hello World!</value>
                <ref local="oracle"/>
            </list>
        </property>
    </bean>
</beans>

///////////////////////////////////////////////////////////////////////////////////////

public interface Oracle {

    public String defineMeaningOfLife();
}

///////////////////////////////////////////////////////////////////////////////////////
public class Encyclopedia {

}

 

///////////////////////////////////////////////////////////////////////////////////////

public class BookwormOracle implements Oracle {

    private Encyclopedia enc;

    public void setEncyclopedia(Encyclopedia enc) {
        this.enc = enc;
    }

    public String defineMeaningOfLife() {
        return "Encyclopedia's are a waste of money - use the Internet";
    }

}

///////////////////////////////////////////////////////////////////////////////////////
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.FileSystemResource;

public class CollectionInjection {

    private Map map;

    private Properties props;

    private Set set;

    private List list;

    public static void main(String[] args) {
        BeanFactory factory = new XmlBeanFactory(new FileSystemResource(
                "build/beans.xml"));

        CollectionInjection instance = (CollectionInjection) factory.getBean("injectCollection");
        instance.displayInfo();
    }

    public void setList(List list) {
        this.list = list;
    }

    public void setSet(Set set) {
        this.set = set;
    }

    public void setMap(Map map) {
        this.map = map;
    }

    public void setProps(Properties props) {
        this.props = props;
    }

    public void displayInfo() {

        // display the Map
        Iterator i = map.keySet().iterator();

        System.out.println("Map contents:\n");
        while (i.hasNext()) {
            Object key = i.next();
            System.out.println("Key: " + key + " - Value: " + map.get(key));
        }

        // display the properties
        i = props.keySet().iterator();
        System.out.println("\nProperties contents:\n");
        while (i.hasNext()) {
            String key = i.next().toString();
            System.out.println("Key: " + key + " - Value: "
                    + props.getProperty(key));
        }

        // display the set
        i = set.iterator();
        System.out.println("\nSet contents:\n");
        while (i.hasNext()) {
            System.out.println("Value: " + i.next());
        }

        // display the list
        i = list.iterator();
        System.out.println("\nList contents:\n");
        while (i.hasNext()) {
            System.out.println("Value: " + i.next());
        }
    }
}

posted @ 2008-05-05 17:08 江南散人 阅读(607) | 评论 (0)编辑 收藏

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode.解决办法

错误情况:
            java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode.
错误原因:
            (1)当你在一个SQL SERVER的JDBC连接上执行多个STATEMENTS的操作时.
            (2)设置了AutoCommit=false,并且使用 direct (SelectMethod=direct) 模式.
解决方法:
            (1)确保在你的连接上只有一个STATEMENT操作。
            (2)使用手动事务模式时,必须在连接字符串中加上SelectMethod=Cursor.

posted @ 2008-05-05 16:25 江南散人 阅读(1962) | 评论 (0)编辑 收藏

2008年5月4日

使用JBuilder开发WebService,使用独立的项目作为客户端,结果ANT出错,WebLogic9.1版本

开发Web Service没问题,但客户端出问题.
 结果发现是没设置serviceName出现的问题,加上serviceName就没问题了!!

posted @ 2008-05-04 14:54 江南散人 阅读(339) | 评论 (0)编辑 收藏

Exception thrown: java.lang.IllegalStateException解决方法!

在SSH中经常抛出如下异常
Exception thrown: java.lang.IllegalStateException:
No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here

解决方法如下:

(1)所有Hibernate操作必须加入事务代理,有Spring AOP切入!!!

(2)在"transactionAttributes"配置所有方法,缺一个方法都不行!!!

posted @ 2008-05-04 13:25 江南散人 阅读(853) | 评论 (0)编辑 收藏

仅列出标题  

导航

统计

常用链接

留言簿(1)

随笔分类

随笔档案

文章档案

搜索

最新评论

阅读排行榜

评论排行榜