Karthikeya Boyini has Published 2192 Articles

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

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

122 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

113 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

639 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

130 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

108 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

137 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

178 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

FloatBuffer get() method in Java

karthikeya Boyini

karthikeya Boyini

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

239 Views

The value at the current position of the buffer is read and then incremented using the method get() in the class java.nio.FloatBuffer. This method returns the value that is at the current buffer position. Also, the BufferUnderflowException is thrown if underflow situation occurs.A program that demonstrates this is given as ... Read More

How to insert own values into auto_increment column in MySQL?

karthikeya Boyini

karthikeya Boyini

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

819 Views

You can achieve this with the help of INSERT statement i.e, you can simply insert it like a normal insert. The syntax is as follows −INSERT INTO yourTableName (yourIdColumnName, yourColumnName) values(value1, 'value2'); Let us first create a table: mysql> create table InsertValueInAutoIncrement -> ( ... Read More

Advertisements