Author: Editorial Team
-
Sort a stream in Java
1. Introduction In this tutorial, we’ll discuss ways to sort stream with the help of examples. Stream interface provides following overloaded sorted() methods: 2. Sort a list of integers You can use the sorted() method to sort the list in the ascending order. Complete example Output 3. Sort a list of integers in descending order…
-
Web document origin
1. Introduction In this tutorial, we’ll discuss what is a web document’s origin. Understanding a document’s origin is important while discussing other topics like CORS error and Window.localStorage. A document’s origin is defined by following three things of the URL used to access it: 2. Examples Following are same origin: Following are different origin:
-
How to convert Array to Stream?
In Java 8, there are two methods to convert Array into a Stream: 1. Object Arrays In case of object arrays, you can use both Arrays.stream() and Stream.of() methods as both return the same output. Output For object arrays, the Stream.of() method calls the Arrays.stream() method internally. 2. Primitive arrays In case of primitive arrays,…
-
Java 8 StringJoiner
1. Introduction StringJoiner is a new class added in Java 8 in java.util package. This class is very helpful to create string separated by delimiter and having a prefix and suffix. StringJoiner is used to create a sequence of characters separated by a delimiter. You can optionally provide a prefix and suffix to create the…
-
Java program to find first even integer in list of numbers
We’ll see two approaches to get the first even number from a list of numbers. In the first approach, we iterate the list and return the first even number. We’ll use the for loop to iterate the list. In the second approach, we’ll use the Java stream and findFirst() method to get the first even…
-
PL/SQL %ROWTYPE Attribute
1. Introduction The %ROWTYPE attribute enables you declare a record that represents either a partial or full row of a database table or view. For every column of the full or partial row, the record has a field with the same data type and name. If the structure of the row changes, then the structure…
-
PL/SQL %TYPE Attribute
1. Introduction The %TYPE attribute lets you declare a data item of the same data type as a previously declared variable or column. It is not necessary to know the type of the variable while using %TYPE attribute.For example, if you want to declare a variable in a PL/SQL block, which is of the same…
-
PL/SQL – Basic Syntax
1. Introduction In this tutorial, we’ll discuss basic syntax of PL/SQL. There are three parts of PL/SQL subprogram. Declaration part This section starts with the DECLARE. This section is used for declarations of local types, variables and subprograms. This section is optional. Declarations are local to the block and cease to exist when the block…
-
Overview of PL/SQL
1. Introduction In this tutorial, we’ll discuss about PL/SQL. We’ll also discuss its advantages, features and architecture. PL/SQL is the Oracle procedural extension of SQL. An SQL statement is a single statement and does not provide any functionality to group related SQL statements and treat the group as a unit. This problem can be solved…
-
Mapping LOBs in Hibernate
1. Introduction In this tutorial, we’ll discuss mapping LOBs or database Large Objects. We’ll discuss following LOBs: Blob – Binary Large Object. It is used to store large binary data like image, audio, video etc. Clob – Character Large Object. It is used to store large character data like large text file. We’ll not discuss…
