Posts

Important Java Keytool commands

The Most Common Java Keytool Keystore Commands Java Keytool is a key and certificate management utility. It  allows users to manage their own public/private key pairs and certificates . It also allows users to cache certificates. Java Keytool stores the keys and certificates in what is called a keystore. By default the Java keystore is implemented as a file. It protects private keys with a password. A  Keytool keystore contains the private key and any certificates necessary to complete a chain of trust and establish the trustworthiness of the primary certificate. Each certificate in a Java keystore is associated with a unique alias. When creating a Java keystore you will first create the .jks file that will initially only contain the private key. You will then generate a  CSR  and have a certificate generated from it. Then you will import the certificate to the keystore including any root certificates. Java Keytool also several other functions that allow you...

MySQL as Hive metadata store

Hive is a data warehouse system for Hadoop that facilitates easy data summarization, ad-hoc queries, and the analysis of large datasets stored in Hadoop compatible file systems. Hive provides a mechanism to project structure onto this data and query the data using a SQL-like language called HiveQL. At the same time this language also allows traditional map/reduce programmers to plug in their custom mappers and reducers when it is inconvenient or inefficient to express this logic in HiveQL. By Default Hive uses a Derby database to store its metadata. But in most of the clustered production environments it need to have more stable and shareable store to share the metadata between cluster nodes. For Hive to enable those multiuser , remote access features it has to configure MySQL database as its metadata store. Following will give you a step by step way to configure it successfully.  Software versions Hadoop  : 1.0.3 Hive       : 0.9.0 Step 1 : Create hiv...

Parsing XML using Java

The idea here is to parse the employees.xml file with content as below <?xml version="1.0" encoding="UTF-8"?> <Personnel>   <Employee type="permanent">         <Name>Seagull</Name>         <Id>3674</Id>         <Age>34</Age>    </Employee>   <Employee type="contract">         <Name>Robin</Name>         <Id>3675</Id>         <Age>25</Age>     </Employee>   <Employee type="permanent">         <Name>Crow</Name>         <Id>3676</Id>         <Age>28</Age>     ...

Java 1.7 new Language Features and Enhancements

After long time I came back to my blog page and decided to continue filling the space in my blog. In this blog I'm going to write about the new bunch of features coming with all new JAVA 1.7 or JDK 1.7. Once I gone through those features I really realize some of those enhancements are the things that we are waiting until Sun include those features for us. The following enhancements have been added to the Java language: Binary Literals Underscores in Numeric Literals Strings in switch Statements Type Inference for Generic Instance Creation Improved Compiler Warnings and Errors When Using Non-Reifiable Formal Parameters with Varargs Methods The try-with-resources Statement Catching Multiple Exception Types and Rethrowing Exceptions with Improved Type Checking Binary Literals     In Java SE 1.7 it includes the binary number system with the integral types (byte, short, int, long). To specify  number as a binary value it has to add 0b or ...

Spring Util Map Annotation with Enum key

I wanted create java.util.Map in spring context xml file which injects the Map to one of my service class, but i was struggling with this because my Map's key is an enum value , Finally I was able fix that issue as following, in Spring we can specify the key-type and value-type specifically with generics values. That part was the interesting and new part i found time. All it goes as follows. <map      key-type="EnumType">         <entry key="ENUM_VALUE"  value-ref="leastLoadedAssignmentMechanism" /> </map>

How to Master In Stock Trading

The popularization of speculative trading activity in the financial markets, partly due to the development of retail trading solutions offered on the internet, has created a new population of traders in the market. Most of these traders are non-professionals that are attracted by the potential to generate revenue quickly. Falsely Created Expectations- Many novice traders may believe that it is very easy to make money, especially when they are trying a broker service using a free practice account. However, if these traders manage to generate a sudden substantial return, it can lead them to believe that trading is an easy occupation - and one in which revenue can be quickly generated with little work on the part of the trader. For the inexperienced, one good pick can make it seem like market speculation might become the key to success and wealth. Unfortunately, when these inexperienced speculators overtake this virtual investing environment and decide to start trading...

Vaadin SuggestionTextField

This is my first vaadin widget and very first exposure to Vaadin widgets. Earlier I was thinking that Vaading widgetset are very difficult to implement since it uses the GWT as a bottom layer. All of a sudden i got a new requirement to build  suggestion text field that would populate the suggestion list depend on the user key in. Even though Vaadin "Select" has the filtering mode but it doesn't support to get the user key in events and implement the list according to that. I have done some RnD work and decide to build a new Suggestion Text field component since its not available in Vaadin add-ons as well. Vaadin Widget has two main parts one part for server side and other one for client side, client side component it has to implement using GWT basic layer component which will ultimately generate the javascript and transfer that to client side. With this new Vaadin add-on developers can easily integrate this widget set as following Import the jar file to classpath...