serving the solutions day and night

Pages

Monday, March 21, 2011

JAVA String

  1. Convert to String
    //Integer to String
    int number = 1234;
    String strtoint = Integer.toString(number); //1234
    strtoint = "" + number; //1234
    //Double to String
    strtoint = Double.toString(number); //1234.0
    //Long to String
    strtoint = Long.toString(number); //1234
    //Flot to String
    strtoint = Float.toString(number); //1234.0
    //Binary to String
    strtoint = Integer.toBinaryString(number); //10011010010
    strtoint = Integer.toString(number,2); //10011010010
    //Hexadecimal to String
    strtoint = Integer.toHexString(number); //4d2
    strtoint = Integer.toString(number,16); //4d2

Sunday, February 27, 2011

Checkstyle 5.3

  1. CheckStyle is a tool to help programmers to write JAVA coding standard.
  2. Download and unzip checkstyle-5.3 into a convenient directory.
  3. It is a program to inspect your JAVA source code and list/point out errors that deviate from a defined set of JAVA coding standard.
  4. By default it supports the Sun JAVA Code Conventions (sun_checks.xml), and also support any customize coding standard.
  5. It can be invoked with an ANT task, a command line program and integrated into IDE (Eclipse, IntelliJ, NetBeans) and other tools (TextPad).

Sunday, February 20, 2011

Eclipse and Tomcat Confirguration, Create War.

1)Download and extract Eclipse IDE for Java EE Developers

2)Download and extract or install Apache Tomcat

3)Open your browser, type http://localhost:8080 and verify tomcat is running.

Sunday, February 13, 2011

Java Servlet CRON job through Tomcat

Apache Tomcat server won't support to run servelt automatically (Resin will support through <run-at> tag). So i created time scheduler job to perform cron job through Tomcat.

1) Create Schedular Servelt
package com.dns.blog;

import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
/**
* Parser Schedular to run every one hour to parse the file.
*
* @author Daynight
* @version 1.0 02/23/2011
*/

Monday, December 27, 2010

Publish & Add Web Part an Excel Spreadsheet in SharePoint

Add a trusted file location
  1. Go to 'Central Administration' home page -> click 'Application Management' tab -> in the 'Office SharePoint Server Shared Services' section, click 'Create or configure this farm's shared services', You're in the 'Manage this Farm's Shared Services' Page.

  2. Click 'SharedServices1(Default)', it takes to the 'Shared Services Administration: SharedServices1' home page, in the 'Excel Services Settings' section, select 'Trusted file locations' and click 'Add Trusted File Location'.

Thursday, October 7, 2010

Java Database Access Model

This blog is going to explain how to design java database access model?. It contains 3 part, 1st part is for database model code, 2nd part is for access model code and 3rd part is for stored procedure sql code.

Database access model is used to connect database, retrieve records and passing input/output parameters using Stored Procedures. All the connections and transactions are in one class file. Designed simple method which is used to connect database and to produce the result set.

In the class file, one method is taking care of connecting the database, another method is to retrieve the result set and last method is doing for insert, modify and delete the record.