Nancy Den has Published 290 Articles

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

5K+ 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

168 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

5K+ 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

320 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

219 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

How to Navigate through a ResultSet using a JDBC program?

Nancy Den

Nancy Den

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

235 Views

The next() method of the ResultSet interface moves the pointer/Cursor of the current ResultSet object to the next row from the current position. This method returns a boolean value. If there are no rows next to its current position this method returns false, else it returns true.Therefore, using this method ... Read More

IntStream summaryStatistics() method in Java

Nancy Den

Nancy Den

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

606 Views

The summaryStatistics() method in the IntStream class is used to return summary data about the elements of this stream. The syntax is as follows:IntSummaryStatistics summaryStatistics()Create an IntStream and add some elements:IntStream intStream = IntStream.of(30, 60, 90);Now, get the summary data about the above elements:IntSummaryStatistics details = intStream.summaryStatistics();The following is an ... Read More

What is JDBC SQL Escape Syntax Explain?

Nancy Den

Nancy Den

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

2K+ Views

The escape syntax gives you the flexibility to use database specific features unavailable to you by using standard JDBC methods and properties.The general SQL escape syntax format is as follow:{keyword 'parameters'}Following are various escape syntaxes in JDBC:d, t, ts Keywords: They help identify date, time, and timestamp literals. As you ... Read More

What are the methods provided by the ResultSet to navigate through it in JDBC?

Nancy Den

Nancy Den

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

334 Views

We have two types of ResultSet objects namely, forward Only and, bi-directional as the names suggest you can move in only one direction (forward) in forward only ResultSet and, in bidirectional ResultSet you can move the pointer in both directions. The ResultSet interface provides several methods to navigate through both ... Read More

What are save points in JDBC? Explain?

Nancy Den

Nancy Den

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

378 Views

Savepoint interface gives you the additional transactional control. Most modern DBMS, support save points within their environments such as Oracle's PL/SQL.When you set a save point you define a logical rollback point within a transaction. If an error occurs past a save point, you can use the rollback method to ... Read More

Advertisements