Samual Sam has Published 2310 Articles

Create Unit Tuple from another collection in Java

Samual Sam

Samual Sam

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

136 Views

To create Unit Tuple from another collection, use the fromCollection() method.Let us first see what we need to work with JavaTuples. To work with the Unit class in JavaTuples, you need to import the following package −import org.javatuples.Unit;Note − Steps to download and run JavaTuples program. If you are using ... Read More

How to extract part of a URL in MySQL?

Samual Sam

Samual Sam

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

3K+ Views

You need to use SUBSTRING_INDEX() function from MySQL to extract part of a URL. Let us first create a table −mysql> create table DemoTable (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    URL text ); Query OK, 0 rows affected (0.53 sec)Insert some records in the table using insert ... Read More

How to set time zone in a JSP?

Samual Sam

Samual Sam

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

762 Views

The tag is used to copy a time zone object into the specified scoped variable.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueTime zone to expose as a scoped or configuration variableYesNonevarName of the variable to store the new time zoneNoReplace defaultscopeScope of the variable to store the new time ... Read More

How to order last 5 records by ID in MySQL

Samual Sam

Samual Sam

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

404 Views

You can use subquery for this. Let us first create a table −mysql> create table DemoTable (    Id int ); Query OK, 0 rows affected (0.68 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100); Query OK, 1 row affected (0.16 sec) mysql> insert ... Read More

Create Septet Tuple from Array in Java

Samual Sam

Samual Sam

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

127 Views

Let us first see what we need to work with JavaTuples. To work with Septet class in JavaTuples, you need to import the following package −import org.javatuples.Septet;Note − Steps to download and run JavaTuples program. If you are using Eclipse IDE to run Septet Class in JavaTuples, then Right Click ... Read More

What is the use of jsp plugin action element?

Samual Sam

Samual Sam

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

253 Views

The plugin action is used to insert Java components into a JSP page. It determines the type of browser and inserts the or tags as needed.If the needed plugin is not present, it downloads the plugin and then executes the Java component. The Java component can be either ... Read More

Perform complex MySQL insert by using CONCAT()?

Samual Sam

Samual Sam

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

2K+ Views

To perform complex MySQL insert, you can use CONCAT() function. Let us see an example and create a table with StudentId and StudentFirstName.After that, complex MySQL insert will be performed and 'Web Student’ text will get inserted for every value and unique StudentId will get concatenated.The query to create first ... Read More

ByteBuffer asReadOnlyBuffer() method in Java

Samual Sam

Samual Sam

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

522 Views

A read-only byte buffer can be created using the contents of a buffer with the method asReadOnlyBuffer() in the class java.nio.ByteBuffer. The new buffer cannot have any modifications as it is a read-only buffer. However, the capacity, positions, limits etc. of the new buffer are the same as the previous ... Read More

JavaTuples addAtX() method for Septet class

Samual Sam

Samual Sam

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

96 Views

The addAtX() method is used to add value to the Septet Tuple. The index can be set here with the X i.e. the place where the value gets added.Let us first see what we need to work with JavaTuples. To work with Septet class in JavaTuples, you need to import ... Read More

Java Program to check if a Float is Infinite or Not a Number(NAN)

Samual Sam

Samual Sam

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

2K+ Views

To check if a Float is isInfinite, use the isInfinite() method and to check for NAN, use the isNaN() method.Example Live Demopublic class Demo {    public static void main(String[] args) {       float value1 = (float) 1 / 0;       boolean res1 = Float.isInfinite(value1);     ... Read More

Advertisements