April 2016

Java Date format

By | 2017-07-22T23:04:20+00:00 April 16th, 2016|Code Base|

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 in predefined style. DateFormat has predefined 4 styles which can be used for quick formatting [...]

February 2016

January 2016

April 2015

Removing an Item from ArrayList in Java

By | 2017-07-22T23:05:35+00:00 April 21st, 2015|Code Base|

import java.util.ArrayList; import java.util.Iterator; public class ArraylistRemoveExample { public static void main(String args[]) { // Creating an ArrayList of generic type ArrayList<String> arrList = new ArrayList<String>(); /* * Arraylist is a growable array, so initialize size would be 0 and it * will get increases with addition of items in it */ System.out.println("Size of the [...]

Searching an element in arraylist in java

By | 2017-07-22T23:05:45+00:00 April 21st, 2015|Code Base|

There are two method available to search an element in Java import java.util.ArrayList; import java.util.Iterator; public class ArraylistSearchExample { public static void main(String args[]) { // Creating an ArrayList of generic type ArrayList<String> arrList = new ArrayList<String>(); /* * Arraylist is a growable array, so initialize size would be 0 and it * will get [...]

September 2014

October 2013

List down the name of stored procedure in DB

By | 2017-07-22T23:06:44+00:00 October 6th, 2013|Code Base|

/* * Here we will learn to List down the name of stored procedure in DB. */ package jbt; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class ListOfSPName { public static void main(String[] args) throws ClassNotFoundException { Class.forName("oracle.jdbc.OracleDriver"); String serverName = "12.2.6.3"; String portNumber = "1541"; String sid = "SID"; String [...]

Query to get record from table in sql

By | 2017-07-22T23:06:33+00:00 October 6th, 2013|Code Base|

/* * Here we will learn to query record from a Table. */ package jbt; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class QueryRecordFromTable { public static void main(String[] args) throws SQLException, ClassNotFoundException { Class.forName("oracle.jdbc.OracleDriver"); String serverName = "172.20.6.4"; String portNumber = "1541"; String sid = "SID"; String url = "jdbc:oracle:thin:@" [...]

Fetch the result from result set

By | 2017-07-22T23:06:56+00:00 October 6th, 2013|Code Base|

/* * Here we will learn to fetch the result from result set. */ package jbt; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class RetrieveValueFromResultSet { public static void main(String[] args) throws SQLException, ClassNotFoundException { Class.forName("oracle.jdbc.OracleDriver"); String serverName = "12.2.6.4"; String portNumber = "1541"; String sid = "SID"; String url = [...]