Daniol Thomas has Published 209 Articles

What is RowId object in JDBC Explain?

Daniol Thomas

Daniol Thomas

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

421 Views

A RowId is a built-in type of SQL which is an address of a row in a table of a database. The RowId interface of the java.sql package maps with the SQL ROWID value.RowId values are unique for every row and they are the fastest way to access a row. ... Read More

Java Program to minus seconds and nanoseconds from Instant

Daniol Thomas

Daniol Thomas

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

191 Views

Let us first set an Instant:Instant now = Instant.ofEpochMilli(184142540078l);Let us now minus seconds from Instant:Instant resSeconds = now.minusSeconds(50);Let us now minus nanoseconds from Instant:Instant resNanoSeconds = now.minusNanos(10000);Exampleimport java.time.Instant; public class Demo {    public static void main(String[] args) {       Instant now = Instant.ofEpochMilli(184142540078l);       System.out.println(now); ... Read More

LocalTime format() method in Java

Daniol Thomas

Daniol Thomas

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

97 Views

The LocalTime can be formatted with the specified formatter using the format() method in the LocalTime class in Java. This method requires a single parameter i.e. the LocalTime object to be formatted and it returns the formatted LocalTime with the specified formatter.A program that demonstrates this is given as follows:Example Live ... Read More

How to handle Exceptions while working with JDBC applications?

Daniol Thomas

Daniol Thomas

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

134 Views

Whenever a JDBC application encounters an issue while executing SQL statements an SQLException is thrown.This class provides information on the errors that occur while interacting with the database.Following are the main methods of the SQLException class:Sr.NoMethod & Description1int getErrorCode()This method returns the exception code for the Exception occurred.2SQLException setNextException(SQLException ex)Using ... Read More

LocalTime from() method in Java

Daniol Thomas

Daniol Thomas

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

44 Views

An instance of a LocalTime object can be obtained from a Temporal object using the from() method in the LocalTime class in Java. This method requires a single parameter i.e. the Temporal object and it returns the LocalTime object that is obtained from the Temporal object.A program that demonstrates this ... Read More

MonthDay hashCode() method in Java

Daniol Thomas

Daniol Thomas

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

80 Views

The hash code value of the MonthDay can be obtained using the hashCode() method in the MonthDay class in Java. This method requires no parameters and it returns the hash code value of the MonthDay.A program that demonstrates this is given as followsExample Live Demoimport java.time.*; public class Demo {   ... Read More

MonthDay range() method in Java

Daniol Thomas

Daniol Thomas

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

60 Views

The range of values for a ChronoField can be obtained using the range() method in the MonthDay class in Java. This method requires a single parameter i.e. the ChronoField for which the range of values is required and it returns the range of values.A program that demonstrates this is given ... Read More

C++ Program to Implement Wheel Sieve to Generate Prime Numbers Between Given Range

Daniol Thomas

Daniol Thomas

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

248 Views

Wheel Sieve method is used to find prime number between a given range. Wheel factorization is a graphical method for manually performing a preliminary to the Sieve of Eratosthenes that separates prime numbers from composites.In this method, Prime numbers in the innermost circle have their Multiples in similar positions as ... Read More

C++ Program to Implement Sieve of eratosthenes to Generate Prime Numbers Between Given Range

Daniol Thomas

Daniol Thomas

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

2K+ Views

This is C++ program to implement Sieve of Eratosthenes to Generate Prime Numbers Between Given Range. In this method, an integer array with all elements initializes to zero.It follows where each non-prime element’s index is marked as 1 inside the nested loops. The prime numbers are those whose index is ... Read More

MonthDay getMonth() method in Java

Daniol Thomas

Daniol Thomas

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

164 Views

The month name for a particular MonthDay can be obtained using the getMonth() method in the MonthDay class in Java. This method requires no parameters and it returns the month name in the year.A program that demonstrates this is given as followsExample Live Demoimport java.time.*; public class Demo {    public ... Read More

Advertisements