Samual Sam has Published 2492 Articles

What is extends attribute in JSP?

Samual Sam

Samual Sam

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

584 Views

The extends attribute specifies a superclass that the generated servlet must extend.For example, the following directive directs the JSP translator to generate the servlet such that the servlet extends somePackage.SomeClass −

Does it make sense to use “LIMIT 1” in a query “SELECT 1 …”?

Samual Sam

Samual Sam

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

535 Views

Yes, you can use LIMIT 1 with SELECT1.Suppose, you are using SELECT 1 and your table has billions of records. In this case, it will print 1 billion times.The syntax of SELECT 1 is as follows −SELECT 1 FROM yourTableName;Suppose, you are using LIMIT 1 and your table has billions ... Read More

How to print XPath Expression result in JSP?

Samual Sam

Samual Sam

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

261 Views

The tag displays the result of an XPath expression. It functions the same as JSP syntax.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultselectXPath expression to evaluate as a string, often using XPath variablesYesNoneescapeXmlTrue if the tag should escape special XML charactersNotrueExampleLet us take an example which will cover ... Read More

What is the MySQL SELECT INTO Equivalent?

Samual Sam

Samual Sam

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

274 Views

The SELECT INTO equivalent is CREATE TABLE AS SELECT statement. The syntax is as follows −CREATE TABLE yourNewTableName AS SELECT *FROM yourTableName;To understand the above concept, let us create a table. The query to create a table is as follows −mysql> create table selectIntoEquivalentDemo    -> (    -> ClientId ... Read More

IntBuffer compact() method in Java

Samual Sam

Samual Sam

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

93 Views

The buffer can be compacted using the compact() method in the class java.nio.IntBuffer. This method does not require a parameter and it returns the new compacted IntBuffer 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

What is info attribute in JSP?

Samual Sam

Samual Sam

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

252 Views

The info attribute lets you provide a description of the JSP. The following is a coding example −

Select query using MySQL IN() and avoid sorting in it

Samual Sam

Samual Sam

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

233 Views

Using IN() sorts the result for the specific field. To avoid this, use ORDER BY and FIND_IN_SET() for the field.To understand the find_in_set(), let us create a table. The query to create a table is as follows −mysql> create table ProductStock    -> (    -> ProductId int,    -> ... Read More

SecureRandom getSeed() method in Java

Samual Sam

Samual Sam

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

90 Views

The seed bytes as required can be obtained using the method getSeed() in the class java.security.SecureRandom. This method requires a single parameter i.e. the number of seed bytes that need to be generated and it returns the seed bytes as required.A program that demonstrates this is given as follows −Example Live ... Read More

What is language attribute in JSP?

Samual Sam

Samual Sam

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

350 Views

The language attribute indicates the programming language used in scripting the JSP page.For example, because you usually use Java as the scripting language, your language option looks like this −

How to use a value of XPath expression result in JSP in a variable?

Samual Sam

Samual Sam

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

156 Views

The tag sets a variable to the value of an XPath expression.If the XPath expression results in a boolean, tag sets a java.lang.Boolean object; for a string, java.lang.String; and for a number, java.lang.Number.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultvarA variable that is set to the value of ... Read More

Advertisements