Posts

What is Mercurial ?

Mercurial is a fast, lightweight Source Control Management system designed for efficient handling of very large distributed projects. It is mainly implemented using the Python programming language. It is supported on Windows and Unix-like systems, such as Mac OS X and Linux. All of Mercurial's operations are invoked as arguments to its driver program hg, a reference to the chemical symbol of the element mercury. Mercurial's major design goals include high performance and scalability, decentralized, fully distributed collaborative development, robust handling of both plain text and binary files, and advanced branching and merging capabilities, while remaining conceptually simple.  How you can benefit from Mercurial It is fast and powerful, It efficiently handles projects of any size and kind. Every clone contains the whole project history, so most actions are local, fast and convenient. Mercurial supports a multitude of workflows and you can easily enhance its fun...

How to read certificates using CertificateFactory class

In my previous blog , I have explained how can you create self signed certificate using bouncy castle API and how to import it into keystore. This tutorial will explain how to read existing certificate file using java.security.cert.CertificateFactory class. import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.security.KeyStore; import java.security.PublicKey; import java.security.cert.Certificate; import java.security.cert.CertificateFactory; /**  * Reads the certificate and import into Java keystore.  *  * @author abdul  *  */ public class ReadCertificateFile {      /**      * @param args      * @throws Exception      */     public static void main(String[] args) throws Exception {         ReadCertificateFile readCertificateFile = new ReadCertificateFile();   ...

Eclipse - Tips & Tricks

This article is for those who use Eclipse. Keyboards shortcuts are very important for comfortable and quick editing. Here are the list of most important shortcuts in Eclipse : For a full list of shortcuts, you can also check by pressing Ctrl+Shift+L. Ctrl +3 Focus into the Quick Access search box which allows you to execute any Eclipse command. Ctrl+SHIFT+T Search dialog for Java Type, Start typing the name and the list gets smaller. Try typing the capital letters of the class only (e.g. type "NPE" to find "NullPointerException") Ctrl+SHIFT+R Search dialog for resources, e.g. Xml files, text files, or files of any other type. Ctrl+E Open Editor Drop down, Presents a popup window listing currently opened files. Ctrl+O Quick Outline, Show all methods of the current class, Press Ctrl+O a second time to include inherited methods. Ctrl+SHIFT+space Context Information Ctrl+Shift+O Organize Imports, Adjusts the imports ...

Hibernate Configuration

To inform Hibernate from where to find mapping information of Java classes to database tables or configuration setting related to database, All such information is usually supplied by Hibernate Configuration Object. It is managed by an instance of org.hibernate.cfg.Configuration. An instance of org.hibernate.cfg.Configuration represents an entire set of mappings of an application’s Java types to an SQL database. The mappings are compiled from various XML mapping files or from Java 5 Annotations. Hibernate provides following types of configurations hibernate.cfg.xml – A standard XML file which contains hibernate configuration and which resides in root of application’s CLASSPATH  hibernate.properties – A Java compliant property file which holds key value pair for different hibernate configuration strings.  Programmatic configuration – This is the manual approach. The configuration can be defined in Java class.  1. hibernate.cfg.xml : The hibernate.cfg.xml file...

What is Hibernate ?

Image
What is Hibernate ? Hibernate is an  open source java based library used to work with relational databases.  The term Object/Relational Mapping refers to the programming technique for converting data between relational databases and object oriented programming languages such as Java, C# etc. It is a very powerful ORM solution build on top of JDBC API. It was initiated by Gavin King in 2001. It is a persistence framework which is used to store and retrieve data from database. It is a powerful, high performance Object-Relational Persistence and Query service for any Java Application Hibernate  makes use of persistent objects called POJOs (Plain Old Java Objects). Hibernate maps Java classes(POJO) to database tables and from Java data types to SQL data types and relieve the developer from 95% of common data persistence related programming tasks. These objects works as a data carrier called DTO (Data Transfer Object). They are used to carry data between diffe...

What is RPM and How to build your RPM?

Introduction RPM (RPM Package Manager) is a popular utility for installing software on Unix-like systems, particularly Red Hat Linux. The name RPM variously refers to the .rpm file format. I t is an open packaging system available for anyone to use. It allows users to take source code for new software and package it into source and binary form such that binaries can be easily installed and tracked and source can be rebuilt easily. It also maintains a database of all packages and their files that can be used for verifying packages and querying for information about files and/or packages. Design Goals RPM provides the capability to install an entire application with a single command, to track the files it put on the system, and to remove those files by using another single command. Make it easy to get packages on and off the system. Make it easy to verify a package was installed correctly. Make it easy for the package builder. Make it start with original s...

How to integrate Web Application with Salesforce via Oauth

Image
This tutorial shows you the basic of Oauth. We have created a Java Web Application that authenticates the user to salesforce via Oauth 2.0 and then we have performed few CRUD operation via the new API. Setup: SSL enabled Tomcat Server as we have deployed our Web Application on tomcat. Click here for instruction on How to enable SSL on apache Tomcat 7.0 Salesforce Remote Access Application. Click here for instruction on How to create Remote Access Application on Salesforce? Download the application from here and change the name to Services. Run the Project: Check out the project from the above URL, import into the eclipse and Run as a Server. Navigate your browser to https://localhost:8443/Services . You will see the following page: Click on the link and it will take you the salesforce page for Authentication : Once you are login into salesforce, It will ask you to allow the Oauth_Apps to access your data: ...