Category Code Base

How to use optional in java 8 streams

In this article we will learn how to use optional in java 8 streams. Optional is a container object which may or may not contain null value. Some of the most important methods in Optional’s are . So now lets…

Java Date format

Here i will provide list of Java Date formats that are used in Java frequently. There are different ways you can achieve the same result in Java. 1- Using Predefined Format You can directly use DateFormat class to format date…

Generate random number in java

Here you will learn to generate random number in java between two given number by different means. I will try to provide cons for different mechanism so that you can choose what is best for you.

Java String Split

In java you might face a situation where you need to split String, based on some criteria. To fulfill this requirement Java has already provided two in-built methods to achieve this.

How to Create Table in Oracle Using statement in Java

import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.Scanner; /* * Here we will learn to Create Table in DB using JDBC Statements in Oracle and MySQL DB */ public class CreateTableWithStatement { public static void main(String[] args) {…

How to connect to mysql database in java

Here we will learn to connect to MYSQL DB via Java. import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Scanner; /* * Here we will learn to connect to Oracle DB using JDBC Driver. */ public class ConnectMySQLDB { public static…