Tag Archives: Java

How to Upload Multiple Files in Java

package com.mp.ws; /** * * @author nitinaggarwal * */ public interface IFileUpload { public byte[] get1File(String name); public byte[][] getMulitpleFiles(String names[]); public String getXmlFile(String name); } package com.mp.ws; /** * * @author nitinaggarwal * */ public class FileUpload implements IFileUpload { public byte[] get1File(String name) { byte data[] = null; FileReader fr = new FileReader(); […]

read more

Pagination: Server Side or Client Side?

What is it best way to handle pagination/sorting and filtering? Server side or at the client side? Numerous times in your projects you might have to face a situation where you need to pull chunks of data dynamically. The obvious issue that you then face is paginationsorting and filtering. You then start to think if […]

read more

Java Persistence API – Getting Started

The Java persistence API (JPA) allows you to store data from POJO’s (Plain old Java Objects) into database tables. The persistence metadata is specified using Java annotations, XML mapping files or a combination of both. In case both are used then the XML information overwrites the annotations in the Java code. This persistence metadata defines […]

read more

Native XML Web Services in SQL Server 2005

These days, you should hardly be surprised when you run into a business requirement to make data available over the Web. Fortunately, database products are making it easier and easier to hook up Internet protocols directly to your data. Microsoft SQL Server is a case in point. While SQL Server 2000 did allow Web data […]

read more

Java Console and File Input/Output Cheat Sheet

Console OutputSystem.out.print(“Hello “);System.out.println(“world”);Console InputBufferedReader in = new BufferedReader(new InputStreamReader(System.in));String text = in.readLine();File OutputPrintWriter out = new PrintWriter(new FileWriter(“K:locationoutputfile.txt”)));out.print(“Hello “);out.println(“world”);out.close();File InputBufferedReader in = new BufferedReader(new FileReader(“K:locationinputfile.txt”));String text = in.readLine();in.close();Converting input dataString text = in.readLine();int x = Integer.parseInt(text);double y = Double.parseDouble(text);Reading until EOFwhile (in.ready()) { text = in.readLine(); System.out.println(text);}Pulling apart delimited items on a lineString text = […]

read more

Splitting the ALSB Logging

What it does Normally the AquaLogic Service Bus logs in the main Weblogic domain log. This sample code splits the ALSB logging to a separate log. How it Works A startup class is used to direct ALSB log entries to the new ALSB log. A log filter is used to stop the ALSB logs from […]

read more

Reverse Engineering using UML Graph

I have been on several teams where we studiously designed UML diagrams at the beginning of the project. As the project progressed, and deadlines approached, the UML diagrams were left somewhere behind, not to be updated in months. When a new developer joined the team, we showcased the old UML diagrams, and kept telling “Oh, […]

read more