随笔分类 -  Java

javac编译多个带package文件
摘要:m文件夹下有helloworld.java:[代码]内部引用了testpak文件夹下的Test.java:[代码]其中m和package文件夹在同一目录下,编译:C:\java_test>javac m\*.java或者:C:\java_test\m>javac *.java运行:C:\java_test\m>java m.helloworld或者:C:\java_test>... 阅读全文

posted @ 2010-11-24 12:33 廖勇军 阅读(866) 评论(0) 推荐(0)

Java程序放到Linux上出现的问题
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->DateFormatdf=DateFormat.getDateTimeInstance();Datedate=df.parse("2010-10-1010:59:59");在windows的tomcat里跑得好好地,在Linux上竟然不行了,原因不明,换成这样就行了。Code highlighting produced by Actipro CodeHighlighter ( 阅读全文

posted @ 2010-09-01 14:51 廖勇军 阅读(188) 评论(0) 推荐(0)

让tomcat启动后自动进行一些操作
摘要:需求:在Tomcat启动后,自动调用一个WebService接口,得到数据,插入本机的数据库,即同步数据。本身的程序也是WebService,要求不需要外部触发,启动时就同步。Web.xml:[代码]listenerCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.c... 阅读全文

posted @ 2010-08-13 16:27 廖勇军 阅读(395) 评论(0) 推荐(0)

[转]c3p0详细配置
摘要:转自:http://blog.sina.com.cn/s/blog_53345e4c0100b6zk.html官方文档 : http://www.mchange.com/projects/c3p0/index.html<c3p0-config><default-config><!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 --&g... 阅读全文

posted @ 2010-07-12 15:53 廖勇军 阅读(530) 评论(0) 推荐(0)

Hibernate调用带返回值的存储过程的方法
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--CallableStatementstatement=getSession().connection().prepareCall("{callsp_get_keyword_code(?,?,?,?,?... 阅读全文

posted @ 2010-07-08 11:04 廖勇军 阅读(937) 评论(0) 推荐(0)

Java生成Guid
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--packageutils;importjava.net.InetAddress;importjava.net.UnknownHostException;importjava.security.Mess... 阅读全文

posted @ 2010-07-07 17:34 廖勇军 阅读(432) 评论(0) 推荐(0)

Java中汉字转拼音
摘要:需要下载pinyin4j:http://pinyin4j.sourceforge.net/代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--packageutils;importnet.sourceforge.pinyin4j.*;importnet... 阅读全文

posted @ 2010-07-07 17:32 廖勇军 阅读(484) 评论(0) 推荐(0)

Java中使用Hhibernate遇到一个错误:No Dialect mapping for JDBC type:-1
摘要:今天遇到一个错误在使用Hibernate的时候,使用createSQLQuery获取数据。[代码]在query.list()时就出错了:No Dialect mapping for JDBC type:-1意思大概是没有与jdbc类型对应的方言。在数据库中把跟踪到的SQL运行一下,是成功的。根据提示看,rulestr是text类型的,rultype是int类型的,应该不会是rultype的问题,而... 阅读全文

posted @ 2010-07-07 10:23 廖勇军 阅读(831) 评论(0) 推荐(0)

导航