Karthikeya Boyini has Published 2193 Articles

What are various attributes Of page directive in JSP?

karthikeya Boyini

karthikeya Boyini

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

625 Views

Following table lists out the attributes associated with the page directive −S.No.Attribute & Purpose1bufferSpecifies a buffering model for the output stream.2autoFlushControls the behavior of the servlet output buffer.3contentTypeDefines the character encoding scheme.4errorPageDefines the URL of another JSP that reports on Java unchecked runtime exceptions.5isErrorPageIndicates if this JSP page is a ... Read More

CopyOnWriteArraySet in Java

karthikeya Boyini

karthikeya Boyini

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

93 Views

A thread safe version of the set is the CopyOnWriteArraySet in Java. This set uses an CopyOnWriteArrayList internally for the set operations. The CopyOnWriteArraySet was introduced by the JDK 1.5.A program that demonstrates this is given as follows −Example Live Demoimport java.util.concurrent.*; public class Demo extends Thread {    public static ... Read More

How to execute UPDATE SQL in a JSP?

karthikeya Boyini

karthikeya Boyini

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

1K+ Views

The tag executes an SQL statement that does not return data; for example, SQL INSERT, UPDATE, or DELETE statements.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultsqlSQL command to execute (should not return a ResultSet)NoBodydataSourceDatabase connection to use (overrides the default)NoDefault databasevarName of the variable to store the count of ... Read More

Verify that MySQL SET FOREIGN KEY CHECKS is set to = 1?

karthikeya Boyini

karthikeya Boyini

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

901 Views

You can verify SET FOREIGN KEY CHECKS is set to = 1 or not with the help of variable@@foreign_key_checks;The syntax is as follows −select @@foreign_key_checks;You can use SHOW VARIABLES command. The syntax is as follows −show variables like 'foreign%';Now you can implement both the syntaxes.Case 1 − Using variable @@foreign_key_checks.The ... Read More

Java Signature toString() method

karthikeya Boyini

karthikeya Boyini

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

392 Views

The string representation for the signature object can be obtained using the method getString() in the class java.security.Signature. This includes information such as the object state, algorithm name etc. The method getString() requires no parameters and it returns the provider for the signature object.A program that demonstrates this is given ... Read More

What happens when buffer is set to a value "none" in JSP?

karthikeya Boyini

karthikeya Boyini

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

220 Views

The buffer attribute specifies the buffering characteristics for the server output response object.You may code value of "none" to specify no buffering so that the servlet output is immediately directed to the response object or you may code a maximum buffer size in kilobytes, which directs the servlet to write ... Read More

Java Program to find keys from both the Linked HashMap and store it in a list alternatively

karthikeya Boyini

karthikeya Boyini

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

121 Views

Let us first create a LinkedHashMap with key-value pair −Mapmap1 = new LinkedHashMap(); map1.put("1", "Jim"); map1.put("2", "David"); map1.put("3", "Tom"); map1.put("4", "Sam"); map1.put("5", "Steve");Let us now create another LinkedHashMap with key-value pair −Mapmap2 = new LinkedHashMap(); map2.put("6", "Katie"); map2.put("7", "John"); map2.put("8", "Kane"); map2.put("9", "Chris");Now, create a new List and store the ... Read More

Get the date/time of the last change to a MySQL database?

karthikeya Boyini

karthikeya Boyini

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

1K+ Views

You can get the date/time of the last change to a MySQL database with the help of INFORMATION_SCHEMA.TABLES. The syntax is as follows −SELECT update_time FROM information_schema.tables WHERE table_schema = 'yourDatabaseName’' AND table_name = 'yourTableName’;To understand the above syntax, let us create a table. The query to create a table ... Read More

What is contentType attribute in JSP?

karthikeya Boyini

karthikeya Boyini

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

4K+ Views

The contentType attribute sets the character encoding for the JSP page and for the generated response page. The default content type is text/html, which is the standard content type for HTML pages.If you want to write out XML from your JSP, use the following page directive −The following statement directs ... Read More

Java Program to convert LocalDate to java.util.Date by timezone offset

karthikeya Boyini

karthikeya Boyini

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

210 Views

Set the LocalDate to now −LocalDate date = LocalDate.now();Now, set the TimeZone offset −ZoneOffset timeZone = ZoneOffset.UTC;Convert the LocalDate to java.util.Date −Date.from(date.atStartOfDay().toInstant(timeZone))Example Live Demoimport java.time.LocalDate; import java.time.ZoneOffset; import java.util.Date; public class Demo {    public static void main(String[] args) {       LocalDate date = LocalDate.now();       System.out.println("Date ... Read More

Advertisements