In this tutorial I will show how to create a sample JERSEY REST Web Service. We will create Web Service using Maven and will run it on the Tomcat. This tutorial is using: 1) Tomcat 7.0 2) Java 1.6 3) Jax-RS Web Service 4) Maven 5) Eclipse First we need to create a maven […]
No BigData example is complete without WordCount example Here in this example we will learn how to setup spark in standalone mode using Java API with word count example. 1) Create a new maven project in Eclipse. 2) Add Spark dependency in the pom.xml file.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3) Get the SparkConf object in the java class. […]
1) Create a Maven project in Eclipse IDE. 2) Click on Next button 3) Select Maven Archetype. For this one I have chosen maven-archetype-quickstart and click on Next button. 4) Provide GroupID and ArtifactID and click on Finish button. 5) Add Datastax Cassandr Driver dependency in pom.xml file. It will add the JAR file to […]
Here in this article we will see how to perform MongoDB authentication in Java. The MongDB Java Driver version used is 3.0.0. 1) First create the ServerAddress instance ServerAddress serverAddress = new ServerAddress(“localhost”, 27017); 2) Create MongoCredential instance by providing the username and password for your database MongoCredential mongoCredential = MongoCredential.createCredential(“user1”, “demodb”, “pwd1”.toCharArray()); where user1 […]
Class Access Modifiers What does it mean by class access modifiers? This is the way by which one class is accessbile by another class. For e.g. there are two classes say Class A and Class B. Now, how Class A can access Class B will be depending upon the access modifiers defined for Class B. […]
Functional Java is an open source library. It is based on Java 1.5 and it does not require extra supporting libraries for using this. It has been built on top of Java 1.5 to ease out functional programming concepts in the Java language. How to use Functional Java ? Class : Either <A, B> Package […]