Blog Archives
1 … 25 26 27 28 29 30

Spring lookup-method example to inject prototype scoped bean into a singleton scoped bean

Step 1: You need asm and cgilib libraries in addition to Spring libraries shown below.

spring-lokkup-needs-asm-cgilib

Step 2: define the Dao (Data Access Object) interface.

Step 3: Define the Dao implementation.

…

Read more ›



Spring MVC RESTful with JPA, Hibernate & MySQL database beginner in 13 steps

This tutorial combines both

1) Spring 4 MVC RESTful Web Service Beginner Tutorial step by step, which focuses on the RSTful web service and

2) JPA with Hibernate & MySQL database tutorial step by step, which focuses on JPA and Hibernate.

…

Read more ›



Spring MVC Web Application with JPA, Hibernate & MySQL

Controller –Service Layer –DAO Layer –JPA/Hibernate –MySQL Database

Step 1: The pom.xml with JSTL, Spring MVC, JPA, and Hibernate libraries are included as well.

Define the model class Account.java

Step 2: Define the Account.java with 3 fields &

…

Read more ›



Spring tutorial to read .proprties files

Q1. How do you read properties file in spring?
A1. PropertyPlaceholderConfigurer allows you to share a properties files. You can simply share one properties file for all of your build info or you can separate things out, and have multiple properties files in your build script.

…

Read more ›



SQL Tutorial with HSQLDB

This assumes that you have Java setup Java on your machine as illustrated in the “setting up” Java tutorial.

Q. Why use HSQLB?
A. It can be useful in a number of ways.

  • Easy to get started and if you are a beginner,

…

Read more ›



SSH Login without password so that tasks can be automated via shell scripts

Prerequisite

If “openssh-server” & “openssh-client” are not installed in say “hostA”, then install them in “hostA” using “apt-get” with “sudo” for actions with root user privileges.

Setting up passwordless connection

The aim is to connect from “hostA”

…

Read more ›



Top 10 Eclipse short-cut keys every Java developer using eclipse IDE must know

1. CTRL+1

Probably the most useful one. It activates the quick fix and generates lots of code for you. This means less typing.

Generating local variables: For example, if you have written a method call and you highlight it and press Ctrl+1,

…

Read more ›



Top 6 Java 8 features you can start using now

Unlike Java 7, Java 8 has some significant changes. You can get familiarised with the the following simple working code. All you need is Java 8 installed on your machine.

#1: Interface can have static and default methods. This tries to solve the diamond (aka multiple inheriance) issue.

…

Read more ›



Top 6 Spring wiring via JavaConfig [i.e. @Configuration ] examples

Spring Java Configuration (i.e. JavaConfig) provides a pure-Java means of configuring the Spring IoC container. This is gaining popularity as it

  • gives complete control over instantiation and dependency injection.
  • gives type safety & compile-time check
  • supports refactorable configuration & supported by IDEs

Here are some industrial strength wiring examples.

…

Read more ›



Understanding Cloudera Hadoop users

Step 1: A number of special users are created by default when installing and using CDH and Cloudera Manager. For example

Unix user id: hdfs
groups: hdfs hadoop

Unix user id: spark
groups: spark

Unix user id: hive
groups: hive

and so on.

…

Read more ›



Understanding Java 8 Streams and working with collections using Lambda expressions

A stream is an infinite sequence of consumable elements (i.e a data structure) for the consumption of an operation or iteration. Any Collection can be exposed as a stream. The operations you perform on a stream can either be intermediate (map, filter, sorted, … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


Unix remoting interview Q&A for Java developers

Q1 How will you delete files that are older than 7 days in a remote unix server?
A1 By ssh ing to the remote host server

Q2 How will you copy files from a remote server to a local server?

…

Read more ›



Unix script to archive files for auditing

Q1. How will you move files that are older than X (e.g 7) days to their own archive folders to be zipped later on? A1.

you run it like

The files will be archived under “/etc/archive/{date}” … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


1 … 25 26 27 28 29 30

300+ Java Interview Questions - FAQs

Tutorials on Java & Big Data