Samual Sam has Published 2310 Articles

Java Program to sort a List in case insensitive order

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

3K+ Views

Let’s say your list is having the following elements −P, W, g, K, H, t, ETherefore, case sensitive order means, capital and small letters will be considered irrespective of case. The output would be −E, g, H, K, P, t, WThe following is our array −String[] arr = new String[] ... Read More

MySQL If statement with multiple conditions?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

8K+ Views

You can use if statement in a stored procedure with multiple conditions with the help of AND or OR operator. The syntax is as follows −DECLARE X int; DECLARE Y int; SET X = value1; SET Y = value2; IF ( (X < Y AND X > value1 AND Y ... Read More

IntBuffer duplicate() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

140 Views

A duplicate buffer of a buffer can be created using the method duplicate() in the class java.nio.IntBuffer. This duplicate buffer is identical to the original buffer. The method duplicate() returns the duplicate buffer that was created.A program that demonstrates this is given as follows −Example Live Demoimport java.nio.*; import java.util.*; public ... Read More

Is there any JSTL library to parse XML in a JSP?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

225 Views

The JSTL XML tags provide a JSP-centric way of creating and manipulating the XML documents. Following is the syntax to include the JSTL XML library in your JSP.The JSTL XML tag library has custom tags for interacting with the XML data. This includes parsing the XML, transforming the XML data, ... Read More

SecureRandom getProvider() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

110 Views

The provider for the SecureRandom object can be obtained using the method getProvider() in the class java.security.SecureRandom. This method requires no parameters and it returns the provider for the SecureRandom object.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public ... Read More

What is extends attribute in JSP?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

799 Views

The extends attribute specifies a superclass that the generated servlet must extend.For example, the following directive directs the JSP translator to generate the servlet such that the servlet extends somePackage.SomeClass −

Does it make sense to use “LIMIT 1” in a query “SELECT 1 …”?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

770 Views

Yes, you can use LIMIT 1 with SELECT1.Suppose, you are using SELECT 1 and your table has billions of records. In this case, it will print 1 billion times.The syntax of SELECT 1 is as follows −SELECT 1 FROM yourTableName;Suppose, you are using LIMIT 1 and your table has billions ... Read More

How to print XPath Expression result in JSP?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

380 Views

The tag displays the result of an XPath expression. It functions the same as JSP syntax.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultselectXPath expression to evaluate as a string, often using XPath variablesYesNoneescapeXmlTrue if the tag should escape special XML charactersNotrueExampleLet us take an example which will cover ... Read More

What is the MySQL SELECT INTO Equivalent?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

392 Views

The SELECT INTO equivalent is CREATE TABLE AS SELECT statement. The syntax is as follows −CREATE TABLE yourNewTableName AS SELECT *FROM yourTableName;To understand the above concept, let us create a table. The query to create a table is as follows −mysql> create table selectIntoEquivalentDemo    -> (    -> ClientId ... Read More

IntBuffer compact() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

155 Views

The buffer can be compacted using the compact() method in the class java.nio.IntBuffer. This method does not require a parameter and it returns the new compacted IntBuffer with the same content as the original buffer. If the buffer is read-only, then the ReadOnlyBufferException is thrown.A program that demonstrates this is ... Read More

Advertisements