- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Samual Sam has Published 2492 Articles
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
2K+ Views
Let us first get the current date −LocalDate currentDate = LocalDate.now();Now, use the Calendar class and set the locale −Calendar cal = Calendar.getInstance(Locale.US);Now, get the month −int month = cal.get(Calendar.MONTH);Find the Quarter −int quarter = (month / 3) + 1;Exampleimport java.time.LocalDate; import java.util.Calendar; import java.util.Locale; public class Demo { ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
877 Views
You can use $pull operator for this. Let us first create a collection with documents −> db.removeNullDemo.insertOne( ... { ... "_id" : 1, ... "StudentDetails" : [ ... { ... "FirstName": "John", ... "LastName":"Smith", ... ... ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
238 Views
Cookies are text files stored on the client computer and they are kept for various information tracking purposes. JSP transparently supports HTTP cookies using underlying servlet technology.There are three steps involved in identifying and returning users -Server script sends a set of cookies to the browser. For example, name, age, ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
90 Views
Use the DATE_FORMAT(), not FORMATDATE() in MySQL to format date. The correct syntax is as follows −SE LECT *, DATE_FORMAT(yourDateCoumnName, ’yourFormat’) as anyAliasName FROM yourTableNameTo understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table DateFormatDemo -> ( ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
78 Views
The current instance of the clock with the default time zone can be obtained using the method systemDefaultZone() in the Clock Class in Java. This method requires no parameters and it returns the current instance of the clock with the default time zone.A program that demonstrates this is given as ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
128 Views
First, set the Date and ZoneId −Date date = new Date(); ZoneId zone = ZoneId.systemDefault();Now convert the java.util.date to localdate −date.toInstant().atZone(zone).toLocalDate() date.toInstant().atZone(zone).toLocalTime() date.toInstant().atZone(zone).getHour() date.toInstant().atZone(zone).getMinute() date.toInstant().atZone(zone).getSecond()Exampleimport java.time.ZoneId; import java.util.Date; public class Demo { public static void main(String[] args) { Date date = new Date(); ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
2K+ Views
Setting cookies with JSP involves three steps −Step 1: Creating a Cookie objectYou call the Cookie constructor with a cookie name and a cookie value, both of which are strings.Cookie cookie = new Cookie("key", "value");Keep in mind, neither the name nor the value should contain white space or any of ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
64 Views
The with() method is used to create Septet Tuple in Java.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 ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
52 Views
The group is a type of method in MongoDB. It shouldn’t be created as a collection name. Even if you created it, you can easily remove it using getCollection('group').drop();). Let us first create a collection with documents −> db.createCollection('group'); { "ok" : 1 } > db.getCollection('group').insertOne({"StudentName":"Chris"}); { "acknowledged" : ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
7K+ Views
You need to use executeQuery() for this. The syntax is as follows −yourPreparedStatementObject=yourConnectionObject.prepareStatement(yourQueryName); yourresultSetObject=yourPreparedStatementObject.executeQuery();Create a table in the database ‘sample’. The query to create a table is as follows −mysql> create table JavaPreparedStatement -> ( -> Id int, -> Name varchar(10), ... Read More