Wednesday, July 9, 2014

DB2 CHAR VS VARCHAR

CHAR

VARCHAR disadvantages:
- uses 2 extra bytes to store the length
-  needs a little extra effort when storing and manipulating length of VARCHAR -> may affect efficiency


General Rule:
  • Use CHAR if average length of field is more than 6 bytes to save space
    • if average length of field is less than 6 bytes, there will be no storage savings for using char
  • Use varchar for columns with more that 30 characters (can be shorter for others)

Monday, May 12, 2014

Creating a SOAP Web Service


1. Create the Java class with methods you want to be converted as web service
2. Add a WebService annotation to the class
3. Add WebMethod annotation to the web service method. This is optional. All public methods of the web service class are automatically considered a web service method.

Example:
@WebService
public class BookStore{
@WebMethod
 public List<String> getBookNames() {
 }
}
This will create a web service class called BookStoreService.