Nancy Den has Published 330 Articles

MonthDay getDayOfMonth() method in Java

Nancy Den

Nancy Den

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

72 Views

The day of the month for a particular MonthDay can be obtained using the getDayOfMonth() method in the MonthDay class in Java. This method requires no parameters and it returns the day of the month which can be in the range of 1 to 31.A program that demonstrates this is ... Read More

Convert String to IntStream in Java

Nancy Den

Nancy Den

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

212 Views

If you have a string and you want to convert it into IntStream with ASCII values, then it can be easily achieved using the below code.To work with IntStream class, you need to import the following package:import java.util.stream.IntStream;Let’s say the following is our string:String str = "Benz";Convert the above string ... Read More

What is Statement in JDBC?

Nancy Den

Nancy Den

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

611 Views

The Statement interface represents the static SQL statement, it is used to create and execute general purpose SQL statements using Java programs.Creating a statementYou can create an object of this interface using the createStatement() method of the connection interface. Create a statement by invoking this method as shown below.Statement stmt ... Read More

MonthDay atYear() method in Java

Nancy Den

Nancy Den

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

59 Views

The MonthDay can be combined with a year to create a LocalDate using the atYear() method in the MonthDay class in Java. This method requires a single parameter i.e.the year and it returns the LocalDate created by combining MonthDay with the year.A program that demonstrates this is given as follows:Example Live ... Read More

What is PreparedStatement in JDBC?

Nancy Den

Nancy Den

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

10K+ Views

The PreparedStatement interface extends the Statement interface it represents a precompiled SQL statement which can be executed multiple times. This accepts parameterized SQL quires and you can pass 0 or more parameters to this query.Initially this statement uses place holders “?” instead of parameters, later on you can pass arguments ... Read More

MonthDay from() method in Java

Nancy Den

Nancy Den

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

40 Views

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

Comparison of memory-mapped I/O and I/O-mapped I/O

Nancy Den

Nancy Den

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

1K+ Views

In Memory Mapped Input Output −We allocate a memory address to an Input-Output device.Any instructions related to memory can be accessed by this Input-Output device.The Input-Output device data are also given to the Arithmetic Logical Unit.Input-Output Mapped Input Output −We give an Input-Output address to an Input-Output device.Only IN and ... Read More

What is CallableStatement in JDBC?

Nancy Den

Nancy Den

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

6K+ Views

The CallableStatement interface provides methods to execute the stored procedures. Since the JDBC API provides a stored procedure SQL escape syntax, you can call stored procedures of all RDBMS in single standard way.Creating a CallableStatementYou can create an object of the CallableStatement (interface) using the prepareCall() method of the Connection ... Read More

What are Stored procedures in JDBC?

Nancy Den

Nancy Den

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

254 Views

Stored procedures are sub routines, segment of SQL statements which are stored in SQL catalog. All the applications that can access Relational databases (Java, Python, PHP etc.), can access stored procedures.Stored procedures contain IN and OUT parameters or both. They may return result sets in case you use SELECT statements. ... Read More

What is the difference between execute(), executeQuery() and executeUpdate() methods in JDBC?

Nancy Den

Nancy Den

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

18K+ Views

Once you have created the statement object you can execute it using one of the execute methods of the Statement interface namely, execute(), executeUpdate() and, executeQuery().The execute() method: This method is used to execute SQL DDL statements, it returns a boolean value specifying weather the ResultSet object can be retrieved.Exampleimport ... Read More

Advertisements