Nancy Den has Published 330 Articles

How many locking systems are there in JDBC?

Nancy Den

Nancy Den

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

592 Views

You can lock a record, set of records, database table, table-space etc. and when we do we cannot change the locked values. Following are the types of locking in JDBC:Row and Key Locks: These are used to lock a particular row. Using these locks, you can achieve concurrency.Page Locks: These ... Read More

DoubleStream min() method in Java

Nancy Den

Nancy Den

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

75 Views

The min() method of the DoubleStream class returns an OptionalDouble describing the minimum element of this stream, or an empty OptionalDouble if this stream is empty.The syntax is as follows:OptionalDoublemin()Here, OptionalDouble is a container object which may or may not contain a double valueTo use the DoubleStream class in Java, ... Read More

C++ Program to Implement Fermat’s Little Theorem

Nancy Den

Nancy Den

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

597 Views

Fermat's little theorem is one of the fundamental results of elementary number theory and is the basis for the Fermat primality test. The theorem is named after Pierre de Fermat, who stated it in 1640. The Theorem states that if p is a prime number, then for any integer a, ... Read More

What is the use of the method setAutoCommit() in JDBC?

Nancy Den

Nancy Den

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

2K+ Views

If you commit a database, it saves all the changes that have been done till that particular point.You can commit a database using the commit() method. Whenever any issue occurs you can revert the database to this point using the rollback() method. By default, some databases commit the databases automatically. ... Read More

C++ Program to Solve the 0-1 Knapsack Problem

Nancy Den

Nancy Den

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

5K+ Views

In 0-1 knapsack problem, a set of items are given, each with a weight and a value. We need to determine the number of each item to include in a collection so that the total weight is less than or equal to the given limit and the total value is ... Read More

How many types of Result Sets are there in JDBC What are they?

Nancy Den

Nancy Den

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

4K+ Views

There are two types of result sets namely, forward only and, bidirectional.Forward only ResultSet: The ResultSet object whose cursor moves only in one direction is known as forward only ResultSet. By default, JDBC result sets are forward-only result sets.You can move the cursor of the forward only ResultSets using the ... Read More

DoubleStream count() method in Java

Nancy Den

Nancy Den

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

113 Views

The count() method of the DoubleStream class returns the count of the elements in the stream.The syntax is as follows:long count()To use the DoubleStream class in Java, import the following package:import java.util.stream.DoubleStream;Create DoubleStream and add some elements:DoubleStream doubleStream = DoubleStream.of(50.8, 67.9, 35.7, 23.6, 89.9);Now, get the count of elements in ... Read More

The build() method in Java Stream.Builder

Nancy Den

Nancy Den

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

4K+ Views

The build() method in Stream.Builder class is used to build the stream. It returns the built stream.The syntax is as follows:Streaml build()Import the following package for the Stream.Builder class in Java:import java.util.stream.Stream;Declare a Stream.Builder:Stream.Builder builder = Stream.builder();Add some elements in the stream:builder.add("One"); builder.add("Two"); builder.add("Three");Now, use the build() method:Stream str = ... Read More

What are the important methods of the SQLException class?

Nancy Den

Nancy Den

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

208 Views

An SQLException can occur both in the driver and the database. When such an exception occurs, an object of type SQLException will be passed to the catch clause.The passed SQLException object has the following methods available for retrieving additional information about the exception:MethodDescriptiongetErrorCode( )Gets the error number associated with the ... Read More

How to generate Infinite Stream of Integers in Java using IntStream.iterate()

Nancy Den

Nancy Den

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

147 Views

To generate an infinite stream of integer, use the IntStream.iterate(). The method is used to iterator an IntStream.Import the following package for the IntStream class in Java:import java.util.stream.IntStream;The following is an example displaying how to generate Infinite Stream of Integers with IntStream.iterate() in Java:Exampleimport java.util.stream.IntStream; public class Main {   ... Read More

Advertisements