How to deploy ASP.NET WEB Application on Amazon Web Services(AWS)

In this article, we will learn how to deploy a Asp.Net WEB Application on Amazon Web Services(AWS) using AWS Toolkit with visual studio 17. You can also use earlier version of visual studio ( VS 15 or VS 13). If you are planning to learn how to deploy your application on AWS, You need to have AWS subscription. AWS provides 12 months free subscription with some limited features. This is something that attracts the novice learner. We can try AWS free for 12 months with usage per month terms & conditions but I personally think that the free usage is more than enough for personal website. Let’s start!

Continue reading

Share Knowledge
Posted in ASP.NET, AWS | Tagged , , , | 3 Comments

Enable HTTPS with Self-Signed-Certificate in Spring Boot 2.0.2

Hello Spring Boot enthusiasts, I am back again with another article. I hope you enjoyed my last article on different spring boot deployment strategies.  In today’s article, I will demonstrate how to enable SSL/HTTPS in embedded servlet container with a self-signed certificate and access spring boot application over HTTPS scheme. We will also see how to redirect any HTTP request to HTTPS. We will create self-signed certificate with the help of keytool which comes along with the JDK installation. Before getting into actual development, let us first understand basic terminologies which will help us further understanding this article.

Continue reading

Share Knowledge
Posted in Java, Spring Boot | Tagged , , , , , , , , , , | 3 Comments

How to deploy spring boot war in jboss

In this article, we will see what are different strategies to deploy spring boot applications. Spring Boot lets you focus mainly on application development without worrying about some common configurations you used to do in spring. You don’t even need to bother about deployment part while in development stage, thanks to its Embedded servlet container that comes along with spring-boot-starter-web dependency. Isn’t this interesting? We will start by developing a simple spring boot web application and then see how to deploy spring boot war in JBOSS server and some other application servers.

What you will learn??

  • Creating a simple Spring Boot application
  • Deploying to default embedded tomcat servlet container (tomcat 7)
  • Upgrading the embedded tomcat version to tomcat 8
  • Deploying to Jetty Embedded Servlet Container
  • Deploying to External tomcat server as a war
  • Deploying to jboss-eap-7.1 as a war

Continue reading

Share Knowledge
Posted in Java, Spring Boot | Tagged , | 10 Comments

Why Java 8 ?

With this new release, Java 8 is introducing a completely new JVM with full packed of some really exciting features at both the JVM and programming language level.

There are literally dozens of new features that make java even better than previous versions and improvement about performance and optimized coding level with some functional programming features. These additions are under-the-hood improvements either at the compiler, JVM or help-system level.

  • Lambda Expression and Virtual Extension Methods are the highlighting feature of Java 8 which is the implementation of Lambda expressions and supporting features to the Java programming language and platform.
  • To overcome external iteration, Java 8 Stream API was introduced. We can use Java Stream API to implement internal iteration.
  • To use lambda expression, we need to create either our own functional interface or we can use pre-defined functional interface provided by Java-8 with @FunctionalInterface.

 

  • Java 8 introduced forEach() and forEachOrdered() method to iterate over Collection and streams.
  • Internal iterationprovides several features such as sequential and parallel execution with multithreaded environment.
  • Stream operations have two functional characteristics: 

                                           i) Pipelining and ii) Internal Iteration

  • Java 8 added new Optional type gives developers most significant flexibility when dealing with null values, which reduces the likelihood of NullPointerExceptions.
  • In many cases, Java 8 will improve application performance without any specific work or tuning by using multithreaded environment.
  • Java 8 new Date and Time API will allow developers to handle date and time in a more efficient and natural way.
  • A new JavaScript engine “Nashhorn” is integrated with Java 8. When we integrate JS into backend that we don’t worthier about setting up node.js instance, we can simply use JVM to execute the code.
  • Concurrent Accumulators enable you to very efficiently increase / decrease the value of a counter in a thread safe manner. This is really a case where it’s not a question of taste, or preference – using these new classes in your code is really a no-brainer.
  • Java 8 provides Improved Security which replaces the existing hand-maintained list of caller sensitive methods with a mechanism that accurately identifies those methods and it allows its callers to be discovered reliably.
  • Aggregate operations:Streams support SQL-like operations and common operations from functional programing languages, such as filter, map, reduce, find, match, sorted, and so on.
  • In Java 8 , staticand default keyword to create interfaces with method implementation. forEach method implementation in Iterable interface is:
default void forEach(Consumer<? super T> action) {
Objects.requireNonNull(action);

for (T t : this) {
action.accept(t);
}

}

Since, Java doesn’t provide multiple inheritance in class level because it leads  to Diamond Problem. So how it will be handled with interfaces now, since interfaces are now similar to abstract classes.

  • parallelSort() method introduces with the multi threaded concept which makes it much faster than previous sorting methods. The parallel sort uses Fork/Join framework.
  • Java 8 has introduced  forEach method in lang.Iterable interface so that while writing code developers only focus on business logic only.
  • The :: operator is used to make method reference to separate the Class and Object from the method name.
Eg: str -> System.out.println(str)
System.out::println
  • A Part of these improvements java 8 improves some miscellaneous core API improvements Like:
    • ThreadLocal static method withInitial(Supplier supplier) to create instance easily.
    • min(), max() and sum() added in Integer, Long and double wrapper classes.
    • logicalAnd(), logicalOr() and logicalXor() methods in Boolean classes.
    • To invoke javascript “Nashrom” engine jjs command is added.
    • For Zip file entries, ZipFile.stream() method to get an ordered stream over zip file entries
    • Various utility methods added in Math class.
    • Comparator interface extended with a lot of default and static methods for natural ordering or reverse order etc.
    • To analyze class files a new command “jdeps” has been added.
    • JDBC-ODBC bridge and PermGen (Permanent Generation) memory space has been removed.
    • jis command is added to invoke Nashorn Engine.
Share Knowledge
Posted in Java, Java 8 | Tagged , , | 12 Comments

SQL Server Interview Questions and Answers Day – 3

Before going through SQL Server Interview Questions and Answers Day – 3,  I would like to recommend you to go through previous article :
SQL Server Interview Questions and Answers Day – 1
SQL Server Interview Question and Answers Day -2

What is View ?
View is nothing but a Virtual table which is used the retrieve data from one table or multiple tables. There is no physical existence view in a database. Basically view is used to create a subset of a table or multiple tables.
View is used to summarize data from various tables which can be used to generate reports.

Continue reading

Share Knowledge
Posted in INTERVIEW QUESTIONS, SQL SERVER | Tagged , , | Leave a comment