随笔分类 -  JavaSE

摘要:<?xmlversion="1.0"encoding="UTF-8"?><projectname="firstAnt"default="createdoc"><propertyname="src.dir"value="src"/><propertyname="doc.dir"value="doc"/><targetname="createdoc"><d 阅读全文
posted @ 2011-03-23 19:12 qiang.xu 阅读(1496) 评论(0) 推荐(0) 编辑
摘要:1. ant简介2. ant部署web application demo3. 拓展问题,如果通过java代码形式来部署一个tomcat应用程序1. ant简介ant是一种java的build工具,类似于unix上的make工具,官方网站:http://ant.apache.org/,logo是一个小蚂蚁。2. ant部署web application demo/Files/xuqiang/j2se/ant-sample.rar可能出现错误记录及注意事项如下: 1.taskdef class org.apache.catalina.ant.DeployTask cannot be found:将 阅读全文
posted @ 2011-03-21 21:05 qiang.xu 阅读(1542) 评论(0) 推荐(0) 编辑
摘要:getPropertiesDetermines the current system properties.First, if there is a security manager, itscheckPropertiesAccessmethod is called with no arguments. This may result in a security exception.The current set of system properties for use by thegetProperty(String)method is returned as aPropertiesobje 阅读全文
posted @ 2011-01-08 10:10 qiang.xu 阅读(2802) 评论(0) 推荐(0) 编辑
摘要:// 判断这个mail是否是一个合法的mail private boolean isValidateEmail(String mail) { String check = &quot;^([a-z0-9A-Z]+[-|\\._]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$&quot;; Pattern regex = Pattern.compile(check); Matcher matcher = regex.matcher(mail); return matcher.match 阅读全文
posted @ 2010-11-23 14:38 qiang.xu 阅读(270) 评论(0) 推荐(0) 编辑
摘要:转载自:http://blog.csdn.net/zhqingyun163/archive/2009/10/29/4744365.aspx今天写代码遇到一个奇怪的问题,具体代码不贴出了,写一个简化的版本。如下:ArrayList&lt;String&gt; list=new ArrayList&lt;String&gt;();String strings[]=(String [])list.toArray();这样写代码个人觉得应该没什么问题,编译也没有问题。可是具体运行的时候报异常,如下:Exception in thread &quot;main&a 阅读全文
posted @ 2010-11-23 14:37 qiang.xu 阅读(22373) 评论(0) 推荐(1) 编辑
摘要:The Constructor Date(String) is Deprecated since of JDK 1.1 you should not use itYou should use java.text.SimpleDateFormat to convert String value to Date. E.g.1private static final SimpleDateFormat sdf = new SimpleDateFormat(&rdquo;yyyy-MM-dd&rdquo;);2String birthDate = &ldquo;1981-12-3 阅读全文
posted @ 2010-11-20 11:22 qiang.xu 阅读(2048) 评论(0) 推荐(0) 编辑
摘要:/*Some SMTP servers require a username and password authentication before youcan use their Server for Sending mail. This is most common with coupleof ISP's who provide SMTP Address to Send Mail.This Program gives any example on how to do SMTP Authentication(User and Password verification)This is 阅读全文
posted @ 2010-11-17 22:05 qiang.xu 阅读(420) 评论(0) 推荐(0) 编辑
摘要:java.util.Date utilDate = new java.util.Date(); java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime()); 阅读全文
posted @ 2010-10-17 18:44 qiang.xu 阅读(171) 评论(0) 推荐(0) 编辑
摘要:DateDeprecated.As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date) or GregorianCalendar(year + 1900, month, date).Allocates a Date object and initializes it so that it represents midnight, local time, at the beginning of the day specified by the year, month, and date argumen 阅读全文
posted @ 2010-10-17 18:43 qiang.xu 阅读(166) 评论(0) 推荐(0) 编辑
摘要:cannot instantiate the type:没有办法实例化这个类,检查类的构造函数是否是private,或者这个类是否是抽象类。 阅读全文
posted @ 2010-10-10 09:21 qiang.xu 阅读(17749) 评论(0) 推荐(2) 编辑
摘要:1。java测试文件结尾import java.io.BufferedInputStream;import java.io.DataInputStream;import java.io.FileInputStream;import java.io.IOException;public class MainClass { public static void main(String[] args) throws IOException { DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInput 阅读全文
posted @ 2010-09-21 09:30 qiang.xu 阅读(299) 评论(0) 推荐(0) 编辑
摘要:/* * Scanner.java */ package SyntaxScanner;public class Scanner{ public static void main(String[] args) { // 这里实现此法分析的主程序 Utils utils = new Utils(); }} javac -d . Scanner.java 阅读全文
posted @ 2010-09-19 20:22 qiang.xu 阅读(162) 评论(0) 推荐(0) 编辑
摘要:http://bytes.com/topic/java/answers/18107-test-if-string-integer"dave" &lt;go_away_you_spammer_scum@nowhere.com&gt; wrote in messagenews:FAHJc.59786$Xb4.4468@nwrdny02.gnilink.net...[color=blue]&gt; I am reading input from a form. I want to validate the input by making[/color]su 阅读全文
posted @ 2010-09-19 20:01 qiang.xu 阅读(285) 评论(0) 推荐(0) 编辑
摘要:swing程序中如何响应鼠标回车事件?参考这里实现:http://topic.csdn.net/u/20090806/17/b49846f5-cd76-467e-9b7c-21fe41846095.html其实很简单的mainFrame.getRootPane().setDefaultButton(loginButton);mainFrame是你的主窗体,loginButton是你说的确定按钮,你敲下回车就可以看见执行的是你loginButton注册好的事件监听代码另外参考:http://topic.csdn.net/u/20070804/13/a839e965-cd9d-46f4-bf77- 阅读全文
posted @ 2010-07-09 15:23 qiang.xu 阅读(886) 评论(0) 推荐(0) 编辑
摘要:netbeans中使用java读取access出现乱码?1.netbeans j2se读取access乱码http://blog.csdn.net/ouanui/archive/2007/07/17/1694970.aspxhttp://topic.csdn.net/u/20091215/19/4b4446a7-5cc6-4ff8-84f8-3700e03e8214.html.http://www.enet.com.cn/article/2008/0229/A20080229170410.shtmlhttp://wenwen.soso.com/z/q149891496.htm2.解决方法:上面 阅读全文
posted @ 2010-07-09 15:19 qiang.xu 阅读(586) 评论(0) 推荐(0) 编辑
摘要:http://ajava.org/hot/print/16569.htmlhttp://www.techienuggets.com/Comments?tx=25302625472008-02-18 14:44:11.0Can you tryJasperViewer jrviewer = new JasperViewer(jasperPrint, false);instead ofJasperViewer jrviewer = new JasperViewer(jasperPrint);and see if it works?http://jasperreports.sourceforge.ne 阅读全文
posted @ 2010-07-06 11:18 qiang.xu 阅读(821) 评论(0) 推荐(0) 编辑
摘要:参考 :http://www.javaeye.com/topic/34155http://topic.csdn.net/u/20081226/15/b117817f-806d-42df-bf1b-b6c0fbdd5991.htmlhttp://feicer.javaeye.com/blog/573290http://www.blogjava.net/bing/archive/2009/12/09/305270.html只需要将hibernate的映射文件.hbm.xml文件中:&lt;property name="reTime" type="date&qu 阅读全文
posted @ 2010-07-03 23:28 qiang.xu 阅读(507) 评论(0) 推荐(0) 编辑
摘要:http://jasperforge.org/plugins/espforum/view.php?group_id=112&amp;forumid=102&amp;topicid=49316JasperServer Discussion/Help Topic: Forum ToolsThreaded viewMark as Read#49316 api.JSExceptionWrapper: Byte data not found at loc 12/04/2008 18:36 Image errorI have up loaded our logo in to the i 阅读全文
posted @ 2010-06-30 11:26 qiang.xu 阅读(4980) 评论(0) 推荐(0) 编辑
摘要:在使用JasperReport中,出现java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException错误,但是在整个程序中没有使用groovy,那么可能是在其他包中需要使用这个class,同时参考:http://sunky045.javaeye.com/blog/5033151.spring+jasperReport生成PDF格式的报表时报 java.lang.NoSuchMethodError: com.lowagie.text.pdf.PdfWriter.setRgbTransp 阅读全文
posted @ 2010-06-28 21:47 qiang.xu 阅读(12758) 评论(0) 推荐(0) 编辑
摘要:实体类InfoFIle.java private Long id; private String fileId; private String title; private String subtitle; private Integer filetype; private Date updatetime; private String author;InfoFileOther.java private Long id; private Long clicknum; private Long downloadnum; private String fileId; private String 阅读全文
posted @ 2010-06-27 20:29 qiang.xu 阅读(271) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示