- 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
Found 4336 Articles for Java 8
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13573/profile/60_92249-1512715559.jpg)
652 Views
HSQLDB is a relational database management system implemented in pure Java. You can easily embed this database to your application using JDBC. Or you can use the operations separately.Installing HSQLDB:Download the latest version of HSQLDB database.Install HSQLDB following the steps given in HSQLDB Tutorial.Make sure that the HSQLDB database is up and running. The URL to connect to this database is jdbc:hsqldb:hsql://host_name/database_name and the driver class name is org.hsqldb.jdbc.JDBCDriver. Download the driver and set classpath to it.ExampleFollowing JDBC program establishes a connection with HSQL database.import java.sql.Connection; import java.sql.DriverManager; public class ConnectDatabase { public static void main(String[] args) { ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13566/profile/60_88163-1512715024.jpg)
1K+ Views
The refreshRow() method of the ResultSet interface refreshes the current row with the most recent value in the database.rs.refreshRow()Assume we have a table named cricketers_data with 7 records as shown below:+----+------------+------------+---------------+----------------+-------------+ | ID | First_Name | Last_Name | Year_Of_Birth | Place_Of_Birth | Country | +----+------------+------------+---------------+----------------+-------------+ | 1 | Shikhar | Dhawan | 1981-12-05 | Delhi | India | | 2 | Jonathan | Trott | 1981-04-22 | CapeTown | SouthAfrica | | 3 | Lumara | Sangakkara | ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13573/profile/60_92249-1512715559.jpg)
83 Views
The afterLast() method of the ResultSet interface moves the cursor/pointer after the last row of the ResultSet object.rs.afterLast();Assume we have a table name dataset as shown below:+--------------+-----------+ | mobile_brand | unit_sale | +--------------+-----------+ | Iphone | 3000 | | Samsung | 4000 | | Nokia | 5000 | | Vivo | 1500 | | Oppo | 900 | | MI | 6400 | | MotoG ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
341 Views
The range() method of the LongStream class in Java returns a sequential ordered LongStream from startInclusive to endExclusive by an incremental step of 1. This is inclusive of the initial element and exclusive of the last element.The syntax is as follows:static LongStream range(long startInclusive, long endExclusive)Here, startInclusive is the first value, whereas the endExclusive is the last.To use the LongStream class in Java, import the following package:import java.util.stream.LongStream;The following is an example to implement LongStream range() method in Java:Example Live Demoimport java.util.stream.LongStream; public class Demo { public static void main(String[] args) { LongStream longStream = LongStream.range(20L, 25L); ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13566/profile/60_88163-1512715024.jpg)
468 Views
The beofreFirst() method of the ResultSet interface moves the cursor/pointer to its default position i.e. before the first record.rs.beforeFirst();Assume we have a table named cricketers_data with 6 records as shown below:+----+------------+------------+---------------+----------------+-------------+ | ID | First_Name | Last_Name | Year_Of_Birth | Place_Of_Birth | Country | +----+------------+------------+---------------+----------------+-------------+ | 1 | Shikhar | Dhawan | 1981-12-05 | Delhi | India | | 2 | Jonathan | Trott | 1981-04-22 | CapeTown | SouthAfrica | | 3 | Lumara | Sangakkara ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
60 Views
To remove all the elements from the CopyOnWriteArrayList, use the clear() method. It empties the list.The syntax is as follows:void clear()To work with CopyOnWriteArrayList class, you need to import the following package:import java.util.concurrent.CopyOnWriteArrayList;The following is an example to implement CopyOnWriteArrayList class clear() method in Java:Example Live Demoimport java.util.concurrent.CopyOnWriteArrayList; public class Demo { public static void main(String[] args) { CopyOnWriteArrayList arrList = new CopyOnWriteArrayList(); arrList.add(220); arrList.add(250); arrList.add(400); arrList.add(500); arrList.add(650); arrList.add(700); arrList.add(800); System.out.println("CopyOnWriteArrayList String Representation ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
63 Views
The AbstractSequentialList class has the add(int index, E ele) method to add element to the specific position. You can also use the add() method inherited from AbstractList class.add(int index, E ele) methodThe syntax is as follows:add(int index, E ele)Here, index is where the element is to be inserted. The ele is the element to be inserted.To work with the AbstractSequentialList class in Java, you need to import the following package:import java.util.AbstractSequentialList;The following is an example to implement AbstractSequentialList add() method in Java:Example Live Demoimport java.util.LinkedList; import java.util.AbstractSequentialList; public class Demo { public static void main(String[] args) { ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13569/profile/60_88876-1512715262.jpg)
325 Views
The insertRow() method of the ResultSet interface inserts a new row into the ResultSet object as well as the table.//Deleting a column from the ResultSet object rs.insertRow();Assume we have a table named cricketers_data with 6 records as shown below:+----+------------+------------+---------------+----------------+-------------+ | ID | First_Name | Last_Name | Year_Of_Birth | Place_Of_Birth | Country | +----+------------+------------+---------------+----------------+-------------+ | 1 | Shikhar | Dhawan | 1981-12-05 | Delhi | India | | 2 | Jonathan | Trott | 1981-04-22 | CapeTown | SouthAfrica | | ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
84 Views
To set key in the JavaTuples KeyValue class, you need to use the setKey() method. Let us first see what we need to work with JavaTuples. To work with KeyValue class in JavaTuples, you need to import the following package:import org.javatuples.KeyValue;Note: Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project → Properties → Java Build Path → Add External Jars and upload the downloaded JavaTuples jar file. Refer the below guide for all the steps to run JavaTuples:Steps: How to run JavaTuples program in EclipseThe following is an example to set ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
95 Views
To fetch the key from a KeyValue tuple in Java, use the getKey() method. Let us first see what we need to work with JavaTuples. To work with KeyValue class in JavaTuples, you need to import the following package:import org.javatuples.KeyValue;Note: Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project → Properties → Java Build Path → Add External Jars and upload the downloaded JavaTuples jar file. Refer the below guide for all the steps to run JavaTuples:Steps: How to run JavaTuples program in EclipseThe following is an example to fetch the ... Read More