Nancy Den has Published 290 Articles

C++ Program to Implement Bucket Sort

Nancy Den

Nancy Den

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

2K+ Views

In the Bucket Sorting technique, the data items are distributed of a set of buckets. Each bucket can hold similar type of data. After distributing, each bucket is sorted using another sorting algorithm. After that all elements are gathered into the main list to get the sorted form.The complexity of ... Read More

Set key in the JavaTuples KeyValue class

Nancy Den

Nancy Den

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

120 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 ... Read More

How to insert Timestamp value in a database using JDBC program?

Nancy Den

Nancy Den

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

4K+ Views

Timestamp datatype in SQL is similar to Date (in SQL) both store day:month:year:hour:minute:second. In addition to this timestamp stores fractional seconds too.Inserting Timestamp in to a databaseThe PreparedStatement interface provides a method named setTimestamp() this method accepts two parameters an integer variable representing the parameter index of the place holder ... Read More

The add() method of Java AbstractSequentialList class

Nancy Den

Nancy Den

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

100 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 ... Read More

The clear() method of CopyOnWriteArrayListin Java

Nancy Den

Nancy Den

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

96 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 ... Read More

How to insert current date and time in a database using JDBC?

Nancy Den

Nancy Den

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

6K+ Views

The time stamp dataType in MySQL database stores day, month, year, hour, minute, second, fractional seconds. Using this you can represent date and time at once.There are two ways to insert/get current time stamp values while working with JDBC.Using the database default value for a date.Using the getTime() method of ... Read More

LongStream range() method in Java

Nancy Den

Nancy Den

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

514 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 ... Read More

LocalTime getNano() method in Java

Nancy Den

Nancy Den

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

211 Views

The nanosecond of second for a particular LocalTime can be obtained using the getNano() method in the LocalTime class in Java. This method requires no parameters and it returns the nanosecond of second in the range of 0 to 999, 999, 999.A program that demonstrates this is given as followsExample Live ... Read More

What is batch processing in JDBC?

Nancy Den

Nancy Den

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

373 Views

Grouping related SQL statements into a batch and executing/submitting them at once is known as batch processing.While executing a set of statements one after other the execution switches from the database to program simultaneously.Using batch processing we can reduce this communication overhead and increase the performance of our Java application.For ... Read More

Write an example JDBC program demonstrating the batch processing with statement object?

Nancy Den

Nancy Den

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

180 Views

Grouping related SQL statements into a batch and executing/submitting them at once is known as batch processing. The Statement interface provides methods to perform batch processing such as addBatch(), executeBatch(), clearBatch().Follow the steps given below to perform batch updates using the Statement object:Register the driver class using the registerDriver() method ... Read More

Advertisements