Tag: java

Excel to MySQL using Java

Target Audience: Java Developers, Database Developers What should you know already? Basics of Java, JDBC Excel to MySQL conversion can be done using LOAD DATA INFILE command as I discussed in Excel to MySQL blog. But that command is inadequate when you need to read the excel cell value and making some calculations or concatenations …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/05/excel-to-mysql-using-java/

JLayer component

The JLayer class is a flexible and powerful decorator for Swing components, which enables you to implement various advanced painting effects as well as receive notifications of all AWTEvents generated within its borders. It enables you to draw on components and respond to component events without modifying the underlying component directly. JLayer is a good solution if …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/04/jlayer-component/

Replace Special Characters Using Java

Using Java, have you ever been tried to replace all special characters in a String? Here is the fine example of replacing all special characters in a String using replaceAll() method. It also discusses about the difference between replace and replaceAll methods of java.lang.String class.

Permanent link to this article: https://blog.openshell.in/2011/03/replacing-special-characters-using-java/

Exception Handling Provided by Struts

Exception Handling Capabilities of Struts Target Audience: J2EE Developers, Web Component Developers What you should know already: MVC Design Pattern, Struts Framework, Struts configuration file Exception handling is very crucial part in Web application development. Throwing an exception is Java’s way of informing the client that something has gone wrong while doing a certain processing …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/12/exception-handling-provided-by-struts/

var args – The magic in Java

Target Audience: Java Developers What should you know? Core Java Writing methods for a class gives completeness for your object. But sometimes it seems to be incomplete when you are not sure about the number of arguments for a method. For example if you are writing a method to find summation of 2 numbers, then …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/12/var-args-the-magic-in-java/

Java Design Pattern

Design Patterns are recurring solutions to design problems. The 23 design patterns included in Design Patterns all had several known applications and were on a middle level of generality, where they could easily cross application areas and encompass several objects. These patterns are divided into 3 types. Creational Patterns: create objects for you, rather than …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/12/java-design-pattern/

Multiple Message Resource Bundle in Struts 1

Target Audience: Web Developer, Web Component Developer What you should know already: Struts Web Framework, MVC Pattern, Knowledge of struts-config.xml file Introduction The message resource class in Struts allows the developer internationalizing web application easy and fast. The user can put labels of fields or description text in a central file and can access them later in the JSP …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/11/multiple-message-resource-bundle-in-struts-1/

Make use of toString() in Java

Every Java beginners must know about toString() method of java.lang.Object class. As you know java.lang.Object is the super most class in Java. Every pre-defined and user-defined class can override the methods available in the class java.lang.Object. Of these, toString() method plays a vital role. See the following example: int x = 100; System.out.println(x); This will …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/11/make-use-of-tostring-in-java/

Configuring JNDI data source in Tomcat

By using Java Naming and Directory Interface (JNDI) service, one can connect resources of different technologies. A typical web application in Tomcat has a file called as context.xml in which the context path (root) of the web application is defined. Usually this file is located in META-INF directory of you web application (see figure 1). …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/11/configuring-jndi-data-source-in-tomcat/