Samual Sam has Published 2492 Articles

How to execute DELETE SQL in a JSP?

Samual Sam

Samual Sam

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

695 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

Differences between TreeMap, HashMap and LinkedHashMap in Java

Samual Sam

Samual Sam

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

334 Views

Details about TreeMap, HashMap and LinkedHashMap that help to differentiate them are given as follows −TreeMap in JavaA TreeMap in Java is implemented using a Red-Black trees. It has key-value pairs i.e. keys that are associated with the values and the keys are ordered. A TreeMap can only have unique ... Read More

Get the strings in the table records that ends with numbers?

Samual Sam

Samual Sam

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

39 Views

You need to use REGEXP for this. The syntax is as follows −select *from yourTableName where yourColumnName REGEXP '[[:digit:]]$';To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table StringEndsWithNumber    -> (    -> Id int NOT NULL ... Read More

What is autoFlush attribute in JSP?

Samual Sam

Samual Sam

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

1K+ Views

The autoFlush attribute specifies whether the buffered output should be flushed automatically when the buffer is filled, or whether an exception should be raised to indicate the buffer overflow.A value of true (default) indicates automatic buffer flushing and a value of false throws an exception.The following directive causes the servlet ... Read More

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

Samual Sam

Samual Sam

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

101 Views

Let us first create a LinkedHashMap with key-value pair −Mapmap = new LinkedHashMap(); map.put("1", "Katie"); map.put("2", "Peter"); map.put("3", "Amy"); map.put("4", "Kane"); map.put("5", "Colin"); map.put("6", "Andre"); map.put("7", "Pollard"); map.put("8", "David"); map.put("9", "Jofra"); map.put("10", "Akila");Now, create a new List and store the keys in it for the above Map −Listlist = new ... Read More

Java Signature getInstance() method

Samual Sam

Samual Sam

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

1K+ Views

A signature object that can implement the required signature algorithm can be obtained using the method getInstance() in the class java.security.Signature. This method requires a single parameter i.e. the standard algorithm name and it returns the signature object.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import ... Read More

How do I remove a uniqueness constraint from a MySQL table?

Samual Sam

Samual Sam

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

123 Views

You can use DROP INDEX for this. The syntax is as follows −alter table yourTablename drop index yourUniqueName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table removeUniquenessConstraint    -> (    -> Id int,    -> Name ... Read More

What is the easiest way to initialize a std::vector with hardcoded elements in C++?

Samual Sam

Samual Sam

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

523 Views

In modern C++ [11, 14, …] a vector is initialized in the following waystd::vector vec = {1, 2, 3};AlgorithmBegin    Initialize the vector v.    Using accumulate, sum up all the elements of the vector v is done.    Print the result. End.Here is a simple example of sum up ... Read More

What are the different quote marks of MySQL?

Samual Sam

Samual Sam

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

222 Views

You can use backticks and single quotes in MySQL. The backtick can be used around the column name and table name while single quotes can be used for the column name values.Let us take an example for both the quote marks. To understand the above syntax, let us create a ... Read More

What is errorPage attribute in JSP?

Samual Sam

Samual Sam

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

496 Views

The errorPage attribute tells the JSP engine which page to display if there is an error while the current page runs. The value of the errorPage attribute is a relative URL.The following directive displays MyErrorPage.jsp when all uncaught exceptions are thrown −The isErrorPage attribute indicates that the current JSP can ... Read More

Advertisements