Showing posts with label Skill Development Lab. Show all posts
Showing posts with label Skill Development Lab. Show all posts

Wednesday, 7 October 2020

How To Add Image in Java Swing JFrame using JLabel

                      In this post, we will see How To Add Image in Java Swing JFrame using JLabel.

Tuesday, 1 September 2020

Thread Life Cycle in Java | Different Phases in the Life Cycle of Thread | Thread Life Cycle Diagram

                    In this post, we will see Thread Life Cycle in Java | Different Phases in the Life Cycle of Thread | Thread Life Cycle Diagram | thread life cycle in java,thread life cycle,thread life cycle in java with example,thread life cycle diagram,thread life cycle methods in java,life cycle of thread in java,life cycle of thread.

Watch this video to know different phases in the life cycle of thread:




Watch on YouTube: https://www.youtube.com/watch?v=7EptP0bli2w


Sunday, 16 August 2020

Deque in Java | Deque Implementation in Java | Deque Data Structure Java with Example

         
                  In this post, we will see Deque in Java | Deque Implementation in Java | Deque Data Structure Java with Example

Queue in Java | Queue in Collection Framework in Java | Queue Data Structure in Java Example

                   In this post, we will see Queue in Java | Queue in Collection Framework in Java | Queue Data Structure in Java Example

Tuesday, 11 August 2020

Priority Queue in Java | Priority Queue Using Heap | Priority Queue Implementation in Java

                
                  In this post, we will see Priority Queue in Java | Priority Queue Using Heap | Priority Queue Implementation in Java

Friday, 7 August 2020

Fix "java.net.BindException: Address already in use" | bind exception in Java Socket Programming

                    In this post, we will see Fix "java.net.BindException: Address already in use" | bind exception in Java Socket Programming | Fix bind exception address already in use |  java.net.BindException | Java Socket Programming | bind exception address already in use,java.net.bindexception address already in use bind,the exception was java.net.bindexception address already in use bind,Exception in thread "main" java.net.BindException: Address already in use (Bind failed)

When we rerun the socket program, we get following error:
Exception in thread "main" java.net.BindException: Address already in use (Bind failed)

Find solution for this exception (error) in this video:




Watch on YouTube: https://www.youtube.com/watch?v=DMoz4VwwJgg

Thursday, 30 July 2020

Generics in Java Programming Language with Example | Method Generics Java | Class Generics Java

                    In this post, we will see Generics in Java Programming Language with Example | Method Generics Java | Class Generics Java

Watch this video to know about Generics in Java Programming Language with Example:




Watch on YouTube: https://www.youtube.com/watch?v=KLDVtPQk4w8

Tuesday, 21 July 2020

HashTable, Properties, Dictionary Data Structure in Java Programming Language

                 In this post, we will see HashTable, Properties, Dictionary Data Structure in Java Programming Language

Watch this video to know about HashTable, Properties, Dictionary Data Structure in Java:




Watch on YouTube: https://www.youtube.com/watch?v=jwzg5BcCExI


Program Code: (HashTableProg.java) 


import java.util.*;
public class HashTableProg {

   public static void main(String args[]) {
     
      Hashtable cls = new Hashtable();
      Enumeration rollno;
      int r;

      cls.put(35,"Parag");
      cls.put(42,"Mayur");
      cls.put(51,"Manish");
      cls.put(60,"Sumit");
     
      rollno = cls.keys();
     
      while(rollno.hasMoreElements()) {
         r = (int) rollno.nextElement();
         System.out.println(r + ": " + cls.get(r));
      }       
      System.out.println();
     
      cls.put(51, "Ramesh");
      System.out.println("New Mapping for 51:"+ cls.get(51));
   }
}
  


Output:
parag@parag-Inspiron-N4010:~/Desktop/prog$ javac HashTableProg.java
Note: HashTableProg.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
parag@parag-Inspiron-N4010:~/Desktop/prog$ java HashTableProg
42: Mayur
51: Manish
60: Sumit
35: Parag

New Mapping for 51:Ramesh
 

Program Code: (PropProg.java) 


import java.util.*;
public class PropProg {

   public static void main(String args[]) {
     
      Properties cls = new Properties();
      Enumeration rollno;
      String r;

      cls.setProperty("Thirty Five","Parag");
      cls.setProperty("Forty Two","Mayur");
      cls.setProperty("Fifty One","Manish");
      cls.setProperty("Sixty","Sumit");
     
      rollno = cls.keys();
     
      while(rollno.hasMoreElements()) {
         r = (String) rollno.nextElement();
         System.out.println(r + ": " + cls.getProperty(r));
      }       
      System.out.println();
     
      cls.setProperty("Fifty One", "Ramesh");
      System.out.println("New Mapping for Fifty One:"+ cls.getProperty("Fifty One"));
   }
}
  


Output:
parag@parag-Inspiron-N4010:~/Desktop/prog$ javac PropProg.java
parag@parag-Inspiron-N4010:~/Desktop/prog$ java PropProg
Sixty: Sumit
Thirty Five: Parag
Fifty One: Manish
Forty Two: Mayur

New Mapping for Fifty One:Ramesh
  

Stack Data Structure using Java | Stack Data Structure Implementation in Java

                    In this post, we will see Stack Data Structure using Java | Stack Data Structure Implementation in Java

Tuesday, 14 July 2020

BitSet Data Structure in Java Programming Language | BitSet in Java

                  In this post, we will see BitSet Data Structure in Java Programming Language | BitSet in Java

Vector Data Structure in Java Programming Language | Vector Data Structure Java

                  In this post, we will see Vector Data Structure in Java Programming Language | Vector Data Structure Java

Monday, 13 July 2020

Enumeration in Java with Example | Enumeration in Java explained with Program Code

                  In this post, we will see Enumeration in Java with Example | Enumeration in Java explained with Program Code

Sunday, 5 July 2020

Socket Programming in Java | Socket Programming in Java Tutorial for Beginners | TCP Socket Example

                  In this post, we will see Socket Programming in Java | Socket Programming in Java Tutorial for Beginners | TCP Socket Example | tcp socket programming in java,tcp socket programming,tcp socket connection,tcp socket programming in java,tcp socket connection explained,tcp socket in java,tcp socket server,socket programming in java,socket programming,socket programming in computer networks

TCP Client Server Program in Java (Socket Programming)
https://www.comrevo.com/2019/07/tcp-client-server-program-in-java-socket-programming.html

Watch this video to understand Socket Programming in Java:




Watch on YouTube: https://www.youtube.com/watch?v=Qzk5v3Lftlw

TCP vs UDP Protocol | TCP vs UDP Difference | TCP vs UDP in Computer Networks

                 In this post, we will see TCP vs UDP Protocol | TCP vs UDP Difference | TCP vs UDP in Computer Networks | tcp vs udp,tcp vs udp in computer networks,tcp vs udp difference,tcp vs udp protocol,tcp vs udp socket,transmission control protocol,user datagram protocol,transmission control protocol vs user datagram protocol,transport layer protocol,transport layer protocols in computer networks

Watch this video to know differences between TCP and UDP protocols:




Watch on YouTube: https://www.youtube.com/watch?v=lZVJGVz5KS0

Socket Programming Basics | What is Socket in Computer Network | Types of Sockets in Networking

                  In this post, we will see Socket Programming Basics | What is Socket in Computer Network | Types of Sockets in Networking | what is socket in computer network,what is socket in networking,types of sockets in networking,types of socket in network programming,socket programming basics

Watch this video to know basics of Socket Programming:




Watch on YouTube: https://www.youtube.com/watch?v=mkcgoJunBWE

Sunday, 21 June 2020

Collection Framework in Java with Realtime Examples | Collections in Java with Examples with Coding

                   In this post, we will see Collection Framework in Java with Realtime Examples | Collections in Java with Examples with Coding | collections in java,collections in java interview questions,collection framework in java,collection framework interview questions,collection framework in java with realtime examples,what is collection framework in java,why collection framework is needed in java,collections in java with examples with coding,collections in java with examples,collections in java with realtime examples,collections in java with examples for beginners.

Watch following video:



Watch on YouTube: https://www.youtube.com/watch?v=2AXjepn67lo

Wednesday, 10 June 2020

Collection Framework in Java | Collection in Java | Collections in Java

                    In this post, we will see Collection Framework in Java | Collection in Java | Collections in Java | collections in java interview questions

What is Collections Framework in Java?
https://www.comrevo.com/2018/07/What-is-Collections-Framework-in-Java.html 


Watch following video:



Watch on YouTube: https://www.youtube.com/watch?v=nyAaFd3vDXA

Monday, 29 July 2019

MySQL stored procedure parameters IN OUT INOUT | How to use parameters in MySQL procedure

                   In this post, we will see MySQL stored procedure parameters IN OUT INOUT.
                   In last post https://www.comrevo.com/2019/07/how-to-create-procedure-in-mysql-database.html, we have seen how to create procedure in MySQL. In this post, we will see how to use parameters in procedure.

For Details, Watch Following Video:

Thursday, 25 July 2019

How to create procedure in MySQL database?

                 In this post, we will see how to create procedure in MySQL database. 
             
What is the need of procedure?

1. By creating procedure, we can run multiple SQL queries in a single call. 

2. Another advantage is that procedure is stored and can be called at any time. No need to write same SQL queries again and again. 

For Demonstration, watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=02clWrruoKE

                 Check following example:

Java MySQL Insert Example using Prepared Statement

                      In this post, we will see Java MySQL Insert Example using Prepared Statement.

                In previous post https://www.comrevo.com/2017/07/jdbc-code-to-insert-data-into-mysql-database.html, we have seen how to insert records (rows) into MySQL database. Here, we will see how to use PreparedStatement. 

For details, watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=S6mJpp5Dg7c

What is the need of Prepared Statement?:
               Sometimes we need to implement same query multiple times e.g. insert query to add multiple records into table. In this situation, only data get changed while the syntax for SQL query remains same. Here, unnecessarily we compile the same query multiple times. To avoid this, we have to use PreparedStatement.

What is PreparedStatement?
               PreparedStatement is an Interface. Stament interface is extended in PreparedStament interface.

               Here sdldb is the database name. User name is sdl and password is sdl123. This program is for inserting records (rows) into MySQL database table student.