- 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
Krantik Chavan has Published 308 Articles
Krantik Chavan
2K+ Views
A ResultSet interface in JDBC represents the tabular data generated by SQL queries. It has a cursor which points to the current row. Initially, this cursor is positioned before the first row.You can retrieve the column value at the current row using the getter methods getInt(), getString(), getDate() etc…To move ... Read More
Krantik Chavan
61 Views
Let us first create a TreeSet and add elements:TreeSet treeSet = new TreeSet(); treeSet.add(10); treeSet.add(20); treeSet.add(30); treeSet.add(40); treeSet.add(50); treeSet.add(60); treeSet.add(70); treeSet.add(80); treeSet.add(90); treeSet.add(100);Now, let’s say you need to set sub set from 50 to 70, then use the subset() for it:SortedSet sub = treeSet.subSet(50, 70); System.out.println("Sub Set = " + ... Read More
Krantik Chavan
43 Views
Let us first create a TreeSet and add elements to it:TreeSet treeSet = new TreeSet(); treeSet.add(20); treeSet.add(50); treeSet.add(100); treeSet.add(120); treeSet.add(150); treeSet.add(200); treeSet.add(250); treeSet.add(300); treeSet.add(350); treeSet.add(400);Now, let us get Tail Set from the TreeSet. In the below case, we will get elements above 200:SortedSet set = treeSet.tailSet(200);Exampleimport java.util.SortedSet; import java.util.TreeSet; public ... Read More
Krantik Chavan
2K+ Views
This represents a scrollable ResultSet i.e. the cursor moves in forward or backward directions. This type of ResultSet is insensitive to the changes that are made in the database i.e. the modifications done in the database are not reflected in the ResultSet.Which means if we have established a connection with ... Read More
Krantik Chavan
3K+ Views
At first set a LocalDateTime:LocalDate date = LocalDate.now(); LocalTime time = LocalTime.now(); LocalDateTime dateTime = LocalDateTime.of(date, time);Now, convert the LocalDateTime to LocalDate and LocalTime:LocalDate localDate = LocalDateTime.now().toLocalDate(); LocalTime localTime = LocalDateTime.now().toLocalTime();Exampleimport java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; public class Demo { public static void main(String[] args) { ... Read More
Krantik Chavan
405 Views
Let’s say the following is the declaration for milliseconds:long millis = 5000000;Now get the hours, minutes and seconds from the milliseconds:long hours = TimeUnit.MILLISECONDS.toHours(millis); long minutes = TimeUnit.MILLISECONDS.toMinutes(millis) - (hours * 60); long seconds = TimeUnit.MILLISECONDS.toSeconds(millis) - ((hours * 60 * 60) + (minutes * 60));Use String.format() to convert the ... Read More
Krantik Chavan
3K+ Views
This represents is a scrollable ResultSet i.e. the cursor moves in forward or backward directions. This type of ResultSet is sensitive to the changes that are made in the database i.e. the modifications done in the database are reflected in the ResultSet.Which means if we have established a connection with ... Read More
Krantik Chavan
76 Views
To format and display date like this i.e. YearMonth, you need to set the pattern:uuuuMMAt first, set a LocalDate:LocalDate localDate = LocalDate.now();Now format and display date as ‘201904’:localDate.format(DateTimeFormatter.ofPattern("uuuuMM"))Exampleimport java.time.LocalDate; import java.time.format.DateTimeFormatter; public class Demo { public static void main(String[] args) { LocalDate localDate = LocalDate.now(); ... Read More
Krantik Chavan
57 Views
To format and display date like this i.e. Day/Month/Year, you need to set the pattern:dd/MM/yyyyAt first, set a LocalDate:LocalDate localDate = LocalDate.now();Now format and display date as '12/04/2019':localDate.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"))Exampleimport java.time.LocalDate; import java.time.format.DateTimeFormatter; public class Demo { public static void main(String[] args) { LocalDate date = LocalDate.now(); ... Read More
Krantik Chavan
2K+ Views
Network Control Protocol (NCP) is a set of protocols forming a part of Point − to − Point Protocol (PPP). PPP is a data link layer protocol that is used to transmit multiprotocol data between two directly connected (point-to-point) computers. PPP is composed of link control protocol (LCP), authentication protocol ... Read More
To Continue Learning Please Login
Login with Google