Interview Questions

External API

Send Bulk SMS using JSMPP

This article contains code examples to send sms to a huge set of subscribers. The input of MSISDN can be provided through a file as comma separated values. The class BulkSMSSender reads the input file of comma separated MSISDN and in turn initiates a pool of threads which executes sendTextMessage() method of SendSMSImpl class. Also there is a JSMPPServer class which acts an SMSC Simulator. It should be run first, which will listen to a port (example- 7001). The SendSMSImpl class sends text message to that port in which the JSMPPServer listens.

Java Create Cron Expression

The following code example provides a way to generate cron expressions in java.

/**
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF

Java Create PDF Document Using iText

/**
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE IS DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS

Java Publishing RSS Feeds

In this article let's discuss about how to publish an RSS feed in java using Rome API.

What is RSS?

RSS(Really Simple Syndication) is a xml format that lets you pull content from another Web site and display it using an RSS feed reader in a standard format.
An RSS document includes full or summarized text, metadata such as publishing dates usually in an xml format.

Send Ringtone Using JSMPP

In this article let's discuss about how to send ring tone sms using jsmpp.
It is very similar to the one we used in the article Send SMS Using JSMPP, except for UDH.

What is UDH?
User Data Header is a header message to be appended before the actual message.
UDH is not required for sending text sms. It is only required for sending binary message.

UDH description is as follows
1. 06 - length of whole UDH i.e. 6 octet, now each octet has two char so 050415811581 count to 6.

Send long SMS message using JSMPP

We have already seen how to send a SMS using JSMPP in the article Send SMS Using JSMPP. Since the length of a text SMS is 140, in order to send a long message containing more than 140 characters, we need to split the message and send with some headers to identify each message which is split.

Returning excel from Http Response

In this article lets discuss about returning an excel file as part of Http Response.

Consider the following table. Lets return an excel sheet containing the following details as an Http response.

EMP_ID EMP_NAME AGE SALARY DEPARTMENT
1001 George 35 50000 IT

Read Contents from Excel using JXL

This article deals with reading from an Excel file using JXL.

In the article Write to Excel Sheet Using POI it has been discussed about how to write "EMPLOYEE DETAILS" into an Excel file using POI. We can use the same Employee Details Excel sheet to read using the JXL API.

Consider the following class which is used to read the contents of an Excel file using JXL.

JxlExcelReader.java

/**
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''

Read Contents from Excel using POI api

This article deals with reading data from an Excel file using POI.

In the article Write to Excel Sheet Using POI it has been discussed about how to write "EMPLOYEE DETAILS" into an Excel file using POI api. We can use the same Employee Details excel sheet to read.

Consider the following class which is used to read the contents of an Excel file using POI.

POIExcelReader.java

/**
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''

SQL Query results to Excel

Given a SQL query, the following class will generate an Excel sheet with the results from the query.

SQLToExcel.java

/**
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF