You may encounter the error java.lang.OutOfMemoryError: Java heap space when running Maven. You can set the heap memory by setting the MAVEN_OPTS environmental variable.
Continue reading Maven – How to set Java Heap Memory
Running a Java program in PHP just like running the shell command as i mentioned yesterday.
Continue reading PHP – Run a Java Program in PHP
The default CentOS repository is quite old and i cannot find what i need. The JPackage Project is designed for providing up-to-date java packages for Linux user. Please refer to the JPackage Official Website for more details.
Continue reading JPackage – Yum Repositories for CentOS, Fedora and Redhat
If you want to use Java Sun JDK instead of OpenJDK on CentOS, u have to install it manually.
Continue reading CentOS – Install Java Sun JDK
I need to write a program which reads a date string. The program then archives all the data on the server with the input date as an cut off date.
The following java program is based on the tutorial in </dream.in.code>. It reads a date string, validate it and print the number of date difference between today and the input date.
Continue reading Java – Date validation using SimpleDateFormat
Recently, i got a support case and it is about the inconsistency of the content length declared in the http header and the actual content length of the http request.
So i modified an existing program which will get the http request and manipulate it. I add some codes such that it will get the request inputStream and count it byte by byte before the request manipulation.
Continue reading Java – Get the content of inputStream from HttpServletRequest
The need of management is always true everywhere — a company, an application as well as yourself. As a programmer. i have been involved in some messy IT projects which have no management at all. Actually this is very common in HK where local companies only want you to complete the tasks before deadline. In such a busy city, seems that quality means nothing and changes come everyday.
Continue reading Maven + SVN + CruiseControl @ 1
By default, the auto commit property of the database connection is set to true. So if you want to rollback the transaction in case there is an exception, you have to set the auto commit to false.
Continue reading JDBC – Java Database Connectivity @ 3
Last time, we have successfully retrieved a value from the database by calling the executeQuery in the Statement object and make use of the ResultSet object to store the returned values. so how about insert, update and delete?
Continue reading JDBC – Java Database Connectivity @ 2
JDBC is an API for Java and it defines how your Java application make connection to the database in order to query or update the data.
In the following example, it shows you how to get a value from the database using the JDBC API. To make use of the API, you have to download the JDBC driver of your database. Postgresql Database is used in this example. so the postgresql-8.4-701.jdbc3.jar is added to the eclipse project.
Continue reading JDBC – Java Database Connectivity @ 1