Samual Sam has Published 2310 Articles

Duration ofSeconds() method in Java

Samual Sam

Samual Sam

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

1K+ Views

The duration can be obtained in a one second format using the ofSeconds() method in the Duration class in Java. This method requires two parameters i.e. the number of seconds and the adjustment required in nanoseconds. Also, it returns the duration in a one second format. If the capacity of ... Read More

The contains() method of Triplet class in JavaTuples

Samual Sam

Samual Sam

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

94 Views

The contains() method is used to search a value in Triplet class.Let us first see what we need to work with JavaTuples. To work with Triplet class in JavaTuples, you need to import the following package −import org.javatuples.Triplet;Note − Steps to download and run JavaTuples program If you are using ... Read More

Duration ZERO field in Java

Samual Sam

Samual Sam

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

592 Views

The ZERO field sets the duration to zero in the Duration class in Java. This field is quite the same as the null value in different data types in Java.A program that demonstrates the ZERO field is given as follows −Example Live Demoimport java.time.Duration; public class Demo {    public static ... Read More

MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=10'?

Samual Sam

Samual Sam

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

792 Views

You can use SET command, but SET OPTIOn deprecated. Therefore, use SET SQL_SELECT_LIMIT.The syntax is as follows −SET SQL_SELECT_LIMIT=yourIntegerValue;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table MySQLSelectDemo    -> (    -> Id int NOT NULL ... Read More

ShortBuffer hasArray() method in Java

Samual Sam

Samual Sam

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

107 Views

It can be checked if a buffer has the backing of an accessible short array by using the method hasArray() in the class java.nio.ShortBuffer. This method returns true if the buffer has the backing of an accessible double array and false otherwise.A program that demonstrates this is given as follows ... Read More

Duration toString() method in Java

Samual Sam

Samual Sam

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

180 Views

The string value of the duration can be obtained using the method toString() in the Duration class in Java. This method requires no parameters and it returns the string value of the duration.A program that demonstrates this is given as follows −Example Live Demoimport java.time.Duration; public class Demo { ... Read More

How to send a simple text based email using a JSP page?

Samual Sam

Samual Sam

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

308 Views

To send an email using a JSP, you should have the JavaMail API and the Java Activation Framework (JAF) installed on your machine.You can download the latest version of JavaMail (Version 1.2) from the Java's standard website.You can download the latest version of JavaBeans Activation Framework JAF (Version 1.0.2) from ... Read More

Is it possible to have View and table with the same name in MySQL?

Samual Sam

Samual Sam

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

1K+ Views

No, you cannot give the same name for view and table in MySQL.Let us first create a demo table −mysql> create table view_Table_Demo    -> (    -> Id int,    -> Name varchar(20)    -> ); Query OK, 0 rows affected (0.80 sec)Now you can insert some records in ... Read More

How to select MySQL rows in the order of IN clause?

Samual Sam

Samual Sam

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

148 Views

You need to use FIND_IN_SET() function to select MySQL rows in the order of IN clause. The syntax is as follows −SELECT yourVariableName.* FROM yourTableName yourVariableName WHERE yourVariableName.yourColumnName IN(value1, value2, ...N) ORDER BY FIND_IN_SET( yourVariableName.yourColumnName, 'value1, value2, ...N');To understand the above syntax, let us create a table. The query to ... Read More

Create Triplet Tuple from another collection in Java

Samual Sam

Samual Sam

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

128 Views

Use the fromCollection() to create a Triplet tuple from another collection. Here, we will create a tuple from List Collection, but let us first see what we need Let us first see what we need to work with JavaTuples. To work with JavaTuples. Let us first see what we need ... Read More

Advertisements