Category: Java

Java, pure object oriented programming language. It has three different editions: Java 2 Standard Edition (J2SE), Java 2 Enterprise Edition (J2EE) and Java 2 Micro Edition (J2ME)

MySQL zerofill and lpad – Shape digits in DB

I’m working with an application to have the item code. Item code column is set as an INT(5) but not all the item code values are 5 digits. So I need to round off the item code based on 5-digits. If the item code is 199, it should be display as 00199. How to make …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/09/mysql-zerofill-and-lpad-shape-digits-in-db/

Best way to order the best matching records in MySQL

If we are searching a word (string) in the mysql table, usually we will use the below method: [sql] SELECT * FROM user WHERE name LIKE ‘%searchstring%’ ORDER BY name ASC; [/sql] If you search like this, It will order the result set based on the ASC of name. It will not order the result …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/08/best-way-to-order-the-best-matching-records-in-mysql/

How to create the JAR file

The JAR file format is a compressed format used primarily to distribute Java applications and libraries. It is built on the ZIP file format, and functions in a similar way; many files are compressed and packaged together in a single file, making it easy to distribute the files over a network. If you need to …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/08/how-to-create-the-jar-file/

How to install maven on Ubuntu

Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project’s build, reporting and documentation from a central piece of information. This will helps you to install Apache Maven 3 on ubuntu. Follow the steps to install: Step1: Before you can …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/08/how-to-install-maven-on-ubuntu/

How To Install Apache Tomcat 8 on Ubuntu

Apache Tomcat is an open source web server used to deploy and serve JavaServer Pages (JSP) and Java Servlets. This will helps you to install Apache Tomcat 8, Apache Tomcat 8 now has its first stable release: 8.0.9. Follow the steps to install Apache Tomcat 8 on Ubuntu: Step 1: Install Java 7 Before you …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/08/how-to-install-apache-tomcat-8-on-ubuntu/

Java Essential Tips: Automatic Resource Management

Java7 introduced many features that simplifies coding which are overhead in older Java versions. In this blog we will see the feature called Automatic Resource Management. This is really a good feature in Java7 which close the resources like IO streams automatically. Everything you need to do is implement java.lang.AutoCloseable. try-with-resources Statement try-with-resources statement simply …

Continue reading

Permanent link to this article: https://blog.openshell.in/2013/08/java-essential-tips-automatic-resource-management/

Access External Property File in Spring Application Context using PropertyPlaceHolderConfigurer

Target Audience: Web Component Developers, Configuration Managers and Deployment Managers What should you know already: J2EE, Spring MVC In an enterprise application we often use property files to share data in Java classes and XML configuration files. The problem is accessing these property files in your code. Whenever you want to read a value out …

Continue reading

Permanent link to this article: https://blog.openshell.in/2012/11/access-external-property-file-in-spring-application-context-using-propertyplaceholderconfigurer/

Java Essential Tips: How to set null value in Java JDBC PreparedStatement

This Java blog explains how to pass ‘null’ values to PreparedStatement. Passing ‘null’ to primitive data types is little tricky.

Permanent link to this article: https://blog.openshell.in/2012/03/java-essential-tips-how-to-set-null-value-in-java-jdbc-preparedstatement/

Java Essential Tips: Static Import

Static Import Static import is a mechanism to include constants into your code without referring its class in which the constants defined. For example, if you are using Integer.MAX_VALUE or some other constants field of class java.lang.Integer then you could simply use the following static import statement: [java]import static java.lang.Integer.*; class Demo{ public static void …

Continue reading

Permanent link to this article: https://blog.openshell.in/2012/01/java-essential-tips-static-import/

Scaling Image Using Java

This blog explains how to scale up or down an image using Java Advanced Image (JAI) API.

Permanent link to this article: https://blog.openshell.in/2011/07/scaling-image-using-java/