Rishi Raj has Published 119 Articles

How can we test for the existence of any record in MySQL subquery?

Rishi Raj

Rishi Raj

Updated on 22-Jun-2020 08:45:22

177 Views

We can use MySQL EXIST operator to test for the existence of a record in the subquery. In other words, we can say that EXIST operator checks if a subquery returns any rows. The syntax of using EXIST operator with MySQL subquery is as follows −SyntaxWHERE EXISTS (Subquery)The above EXIST ... Read More

How can we change the default rules used by the parser for parsing names of built-in functions?

Rishi Raj

Rishi Raj

Updated on 22-Jun-2020 05:52:04

121 Views

The default rules used by the parser for parsing names of built-in-function can be changed by enabling IGNORE_SPACE SQL mode. When we enable this mode, the parser relaxes the requirement that there be no whitespace between the function name and the following parenthesis. For example, after enabling IGNORE_SPACE SQL mode ... Read More

Generating password in Java

Rishi Raj

Rishi Raj

Updated on 21-Jun-2020 15:20:45

13K+ Views

Generate temporary password is now a requirement on almost every website now-a-days. In case a user forgets the password, system generates a random password adhering to password policy of the company. Following example generates a random password adhering to following conditions −It should contain at least one capital case letter.It ... Read More

File Handling in Java using FileReader and FileWriter

Rishi Raj

Rishi Raj

Updated on 21-Jun-2020 14:23:52

1K+ Views

Java Byte streams are used to perform input and output of 8-bit bytes, whereas Java Character streams are used to perform input and output for 16-bit unicode. Though there are many classes related to character streams but the most frequently used classes are, FileReader and FileWriter. Though internally FileReader uses ... Read More

Final Arrays in Java

Rishi Raj

Rishi Raj

Updated on 21-Jun-2020 14:07:08

2K+ Views

A final variable can be explicitly initialized only once. A reference variable declared final can never be reassigned to refer to a different object.However, the data within the object can be changed. So, the state of the object can be changed but not the reference. As an array is also ... Read More

Dynamic method dispatch or Runtime polymorphism in Java

Rishi Raj

Rishi Raj

Updated on 21-Jun-2020 13:12:05

12K+ Views

Runtime Polymorphism in Java is achieved by Method overriding in which a child class overrides a method in its parent. An overridden method is essentially hidden in the parent class, and is not invoked unless the child class uses the super keyword within the overriding method. This method call resolution ... Read More

Difference between HashTable and HashMap in Java

Rishi Raj

Rishi Raj

Updated on 21-Jun-2020 12:35:45

3K+ Views

Following are the notable differences between HashTable and HashMap classes in Java. HashTableHashMapSynchronizedHashTable is synchronized.HashMap is not synchronized.Thread SafeHashTable is thread safe.HashMap is not thread safe.Null objectsHashTable does not allows null keys or null values.HashMap allows one null key and multiple null values.PerformanceHashTable is faster.HashMap is slower than HashTable.Since Java Version1.21.5Exampleimport ... Read More

How can column data be used within MySQL CASE statement?

Rishi Raj

Rishi Raj

Updated on 20-Jun-2020 13:43:50

165 Views

To understand it consider the data, as follows, from the table ‘Students’ −mysql> Select * from Students; +----+-----------+-----------+----------+----------------+ | id | Name      | Country   | Language | Course         | +----+-----------+-----------+----------+----------------+ | 1  | Francis   | UK        | English  | ... Read More

What MySQL returns if we convert an empty hexadecimal value to a number?

Rishi Raj

Rishi Raj

Updated on 20-Jun-2020 12:01:04

112 Views

As we know that an empty hexadecimal value is a zero-length binary string hence if 0 is added to it then the result would be 0. In other words, we can say that if we convert an empty hexadecimal value to a number then it produces 0. The following query ... Read More

What MySQL returns if we pass column name, containing a NULL value, as one of the arguments of CONCAT() function?

Rishi Raj

Rishi Raj

Updated on 20-Jun-2020 08:22:31

130 Views

As we know that CONCAT() function will return NULL if any of the argument of it is NULL. It means MySQL will return NULL if we pass column name, containing a NULL value, as one of the arguments of CONCAT() function. Following is an example of ‘Student’ table to explain ... Read More

Advertisements