Samual Sam has Published 2492 Articles

Set a Pair value in Java Tuple

Samual Sam

Samual Sam

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

2K+ Views

The setAtX() method is used to set the Pair value in JavaTuples and a copy with a new value at the specified index i.e. index x.Let us first see what we need to work with JavaTuples. To work with Pair class in JavaTuples, you need to import the following package ... Read More

What is RowSet? How to retrieve contents of a table using RowSet? Explain?

Samual Sam

Samual Sam

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

1K+ Views

A RowSet object is similar to ResultSet, it also stores tabular data, in addition to the features of a ResultSet a RowSet follows JavaBeans component model. This can be used as a JavaBeans component in a visual Bean development environment, i.e. in environments like IDE’s you can visually manipulate these ... Read More

Java Program to convert java.util.Date to java.time.LocalDateTime

Samual Sam

Samual Sam

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

112 Views

First, set the date −java.util.Date date = new Date();Now, convert the above Date to java.time.LocalDateTime −java.time.LocalDateTime dateTime =    java.time.LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());Exampleimport java.time.ZoneId; import java.util.Date; public class Demo {    public static void main(String[] args) {       java.util.Date date = new Date();       System.out.println("Date = "+date);   ... Read More

Converting isodate to numerical value in MongoDB?

Samual Sam

Samual Sam

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

348 Views

You can use getTime() for this. Following is the syntax −yourVariableName.getTime();Convert ISODate to numerical value −> var arrivalDate=ISODate('2019-04-18 13:50:45');Following is the query to convert ISODate to numerical value −> arrivalDate.getTime();This will produce the following output −1555595445000 Let us verify that it is a correct numerical value for ISODate or not. ... Read More

How to correctly enclose subquery in MySQL?

Samual Sam

Samual Sam

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

168 Views

You need to close the subquery in a parenthesis. The syntax is as follows −select if((select count(*) from yourTableName ), 'Yes', 'No') as anyAliasName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table SelectIfDemo -> ... Read More

Java 8 Clock getZone() method

Samual Sam

Samual Sam

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

130 Views

The time zone required for the date and time creation can be obtained using the method getZone() in the Clock Class in Java. This method requires no parameters and it returns the required time zone.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Demo { ... Read More

Where will be the uploaded files stored in JSP?

Samual Sam

Samual Sam

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

390 Views

A JSP can be used with an HTML form tag to allow users to upload files to the server. An uploaded file can be a text file or a binary or an image file or just any document.Creating a File Upload FormLet us now understand how to create a file ... Read More

Add a value to Pair Tuple in Java

Samual Sam

Samual Sam

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

759 Views

The addAtX() method is used to add a value at a particular position represented by X here. For example, addAt0() at 0 index, addAt1() at 1st index, etc.Let us first see what we need to work with JavaTuples. To work with Pair class in JavaTuples, you need to import the ... Read More

Duration isNegative() method in Java

Samual Sam

Samual Sam

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

72 Views

It can be checked if the duration is negative or not using the isNegative() method in the Duration class in Java. This method requires no parameters. Also, it returns true if the duration is negative and false otherwise.A program that demonstrates this is given as follows −Example Live Demoimport java.time.Duration; public ... Read More

What is a CachedRowSet in JDBC? Explain?

Samual Sam

Samual Sam

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

2K+ Views

The CachedRowSet is the base implementation of disconnected row sets. It connects to the data source, reads data from it, disconnects with the data source and the processes the retrieved data, reconnects to the data source and writes the modifications.Creating a CachedRowSetYou can create a Cached RowSet object using the ... Read More

Advertisements