Java Annotation注释语法
摘要:JAVA从J2SE5开始提供名为annotation(注释,标注)的功能。Java的annotation,可以附加在package, class, method, field等上面,相当于给它们添加了额外的辅助信息。附加在package, class, method, field等上的Annotation,如果没有外部解析工具等对其加以解析和处理的情况,本身不会对Java的源代码或class等产生任何影响,也不会对它们的执行产生任何影响。但借助外部工具,比如javac,EJB容器等,可以对附加在package, class, method, field的annotation进行解析,可以根据a
阅读全文
tomcat5.5建立连接池-JNDI
摘要:首先在application中的WEB-INF/web.xml中添加这样的代码段<context>................................<resource-ref> <res-ref-name>jdbc/hsql</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth></resource-ref></context>然后在应用的ME
阅读全文
在Spring级别,在应用停止的时候,将线程池销毁
摘要:public class ApplicationWatch implements ServletContextListener {private static Logger logger = Logger.getLogger(ArchDataInit.class);public void contextDestroyed(ServletContextEvent event) {logger.info("start ApplicationWatch contextDestroyed method");logger.info("start shutdown threa
阅读全文
netware中基线组归出问题( ClassNotFoundException: org.hibernate.hql.ast.HqlToken )
摘要:问题出现在CE组(他们的环境是最新的),情况是:在登陆之后就到index.jsp出现异常,然后跳转到/page/main.jsp中,就一直处于刷新状态,后台的异常是:org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from com.giantstone.arch.model.ArchEtlGroup]---------------------------------------------------------------------------------------
阅读全文
ant exclude文件夹
摘要:<exclude name="**/WEB-INF/lib/share_lib/**"/> 这样的意思是表示删除share_lib这个文件夹
阅读全文
运行ETL脚本应用不响应
摘要:在使用归档系统的时候发现只要运行过ETL脚本之后,系统就一直不响应了,在使用了java6/bin/jvisualvm这个工具监测应用线程的实时情况之后,发现thread已经满了,因为我使用的是spring中直接用JDBC连接数据库,只是简单的设置了用户名,密码,驱动类,和URL之类的东西,并没有指定它的线程池中的具体设置,所以设置最大活动数(maxActive)和最大等待数(maxWait)都为100之后,问题解决,运行ETL脚本之后,系统还是能迅速地响应。
阅读全文
各种数据库的JDBC连接
摘要:1、Oracle8/8i/9i数据库(thin模式)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();String url="jdbc:oracle:thin:@localhost:1521:orcl"; //orcl为数据库的SID String user="test";String password="test"; Connection conn= DriverManager.getConnection(url,user,passwor
阅读全文
MyEclipse 设置
摘要:设置编辑区的背景颜色:编辑窗口右键单击——》Preferences——》General加号——》Editors加号——》点Text Editors字样——》右下窗口选Backgroud color,右边点掉System Default按钮,点Color右边的颜色框,选择颜色OK
阅读全文
System.setProperty and System.getProperty
摘要:Question:我在一个类里面设置了一个System.setProperty,这个在我启动tomcat的时候也已经初始化了。但当我在有一个类调用System.getProperty时,就会报错,估计是没有这个值,打印出System.getProperty的值是null。我想问的是System.setProperty将数据设置到什么地方去了,在什么范围内System.getProperty可以得到我们设置的那个值。Answer:JDK1.6说明:setPropertypublic static String setProperty(String key, String value)设置指定键指
阅读全文
Version 1.4.2_03 of the JVM not suitable for this product.
摘要:Version 1.4.2_03 of the JVM not suitable for this product.Version1.5 or geeater is required 今天早上启动eclipse时突然报这个错误,翻译过来就是:"jvm虚拟机版本1.42_03不再适合这个项目,要求更换成版本1.5的",其实什么意思,就是使用eclipse-jee-helios-win32 时,eclipse启动报错: Version 1.4.2_03 if the JVM is not suitable for this product. Version 1.5 or greater us re
阅读全文
搞懂java中的synchronized关键字
摘要:实际上,我关于java的基础知识的90%以上都来自Thinking in Java。对于其中的synchronized关键字,当时就是浏览一下,大概知道意思,也没有细看。后来一直没有用过这个关键字。昨天看Thinking in Patterns with Java中的Observer模式,看了其中的Observable类的源码,发现里面几乎所有的方法都用了synchronized关键字(不是全部),其中个别用了synchronized(this){}的区块。于是,我发觉有必要好好理解一下这个关键字了。我再次看了侯捷译的Thinking in Java第二版中文版,得到有关synchronize
阅读全文