Karthikeya Boyini has Published 2383 Articles

Duration dividedBy() method in Java

karthikeya Boyini

karthikeya Boyini

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

55 Views

An immutable copy of a duration where the required duration is divided by a value can be obtained using the method dividedBy() in the Duration class in Java. This method requires a single parameter i.e. the value which is to be divided and it returns the immutable copy of the ... Read More

How can I create custom tag in JSP which can accept attribute from parent jsp page?

karthikeya Boyini

karthikeya Boyini

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

179 Views

You can use various attributes along with your custom tags. To accept an attribute value, a custom tag class needs to implement the setter methods, identical to the JavaBean setter methods as shown below −package com.tutorialspoint; import javax.servlet.jsp.tagext.*; import javax.servlet.jsp.*; import java.io.*; public class HelloTag extends SimpleTagSupport { ... Read More

How to escape characters that can be interpreted as XML markup in JSP?

karthikeya Boyini

karthikeya Boyini

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

827 Views

The fn:escapeXml() function escapes characters that can be interpreted as XML markup.SyntaxThe fn:escapeXml() function has the following syntax −java.lang.String escapeXml(java.lang.String)ExampleFollowing is the example to explain the functionality of the fn:escapeXml() function − Using JSTL Functions ... Read More

FloatBuffer compact() method in Java

karthikeya Boyini

karthikeya Boyini

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

66 Views

The buffer can be compacted using the compact() method in the class java.nio.FloatBuffer. This method does not require a parameter and it returns the new compacted FloatBuffer with the same content as the original buffer. If the buffer is read-only, then the ReadOnlyBufferException is thrown.A program that demonstrates this is ... Read More

KeyFactory getAlgorithm() method in Java

karthikeya Boyini

karthikeya Boyini

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

58 Views

The algorithm name for the KeyFactory can be obtained using the method getAlgorithm() in the class java.security.KeyFactory. This method requires no parameters and it returns the algorithm name for the KeyFactory.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; import java.security.spec.*; public class Demo { ... Read More

How can I set a MySQL database to use MyISAM by default?

karthikeya Boyini

karthikeya Boyini

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

469 Views

To set the default storage engine, use the following syntax −set @@default_storage_engine = ’yourEngineType’;Now implement the above syntax to set the default engine to MyISAM. The query is as follows −mysql> set @@default_storage_engine = 'MyISAM'; Query OK, 0 rows affected (0.05 sec)Now you can check the default engine type with ... Read More

Duration toDays() method in Java

karthikeya Boyini

karthikeya Boyini

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

87 Views

The value of a particular duration in the number of days can be obtained using the toDays() method in Java. This method requires no parameters and it returns the duration in the number of days.A program that demonstrates this is given as follows −Example Live Demoimport java.time.Duration; public class Demo { ... Read More

FloatBuffer hasArray() method in Java

karthikeya Boyini

karthikeya Boyini

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

74 Views

It can be checked if a buffer has the backing of an accessible float array by using the method hasArray() in the class java.nio.FloatBuffer. This method returns true if the buffer has the backing of an accessible float array and false otherwise.A program that demonstrates this is given as follows ... Read More

Duration plusSeconds() method in Java

karthikeya Boyini

karthikeya Boyini

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

91 Views

An immutable copy of a duration where some seconds are added to it can be obtained using the plusSeconds() method in the Duration class in Java. This method requires a single parameter i.e. the number of seconds to be added and it returns the duration with the added seconds.A program ... Read More

Get the number of days between current date and date field?

karthikeya Boyini

karthikeya Boyini

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

99 Views

To get the number of days between current date and date field, the syntax is as follows −SELECT DATEDIFF(CURDATE(), STR_TO_DATE(yourColumnName, '%d-%m-%Y')) AS anyAliasName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table DateDifferenceDemo    -> ( ... Read More

Advertisements