Chandu yadav has Published 1163 Articles

How to read request parameters passed in URL using JSP?

Chandu yadav

Chandu yadav

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

3K+ Views

The following URL will pass two values to HelloForm program using the GET method.href="http://localhost:8080/main.jsp?first_name=ZARA&last_name=ALI" Below is the main.jsp JSP program to handle input given by web browser. We are going to use the getParameter() method which makes it very easy to access the passed information −           ... Read More

MySQL Stored Procedure DEFINER=`root`@`%` is not working in localhost?

Chandu yadav

Chandu yadav

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

1K+ Views

First of all, you need to check the host. The host can be ‘localhost’ or ‘%’. Check the existence of user accounts with host −mysql> select user, host from MySQL.user;This will produce the following output −+------------------+-----------+ | user             | host      | +------------------+-----------+ ... Read More

8086 program to transfer a block of bytes by using string instruction

Chandu yadav

Chandu yadav

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

6K+ Views

In this program we will see how to transfer a block from one location to another location.Problem StatementWrite 8086 Assembly language program to transfer a block from one memory section to another memory section. The numbers are stored at memory offset 501 onwards. The block size is stored at memory ... Read More

MySQL UPDATE query where id is highest AND field is equal to variable?

Chandu yadav

Chandu yadav

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

462 Views

The syntax is as followsupdate yourTableName set yourColumnName1=yourValue where yourColumnName2=yourValue order by yourIdColumnName DESC LIMIT 1;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table UpdateWithHighestDemo    -> (    -> UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,   ... Read More

How to search for a date in MySQL timestamp field?

Chandu yadav

Chandu yadav

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

653 Views

You can use DATE() function from MySQL for this. Let us first create a table −mysql> create table DemoTable (    StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentAdmissionDate timestamp ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql> insert into ... Read More

IntStream map() method in Java

Chandu yadav

Chandu yadav

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

2K+ Views

The IntStream map() method returns the new stream consisting of the results of applying the given function to the elements of this stream.The syntax is as followsIntStream map(IntUnaryOperator mapper)Here, mapper parameter is a non-interfering, stateless function to apply to each elementCreate an IntStream and add some elementsIntStream intStream1 = IntStream.of(20, ... Read More

Selecting Random Result from MySQL?

Chandu yadav

Chandu yadav

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

100 Views

You need to use rand() function to select random result from MySQL.The syntax is as followsselect *from yourTableName order by rand() limit 1;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table selectRandomRecord    -> (    -> StudentId ... Read More

How to read all form parameters in JSP?

Chandu yadav

Chandu yadav

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

1K+ Views

Following is a generic example which uses getParameterNames() method of HttpServletRequest to read all the available form parameters. This method returns an Enumeration that contains the parameter names in an unspecified order.Once we have an Enumeration, we can loop down the Enumeration in the standard manner, using the hasMoreElements() method ... Read More

Why is iostream::eof inside a loop condition considered wrong?

Chandu yadav

Chandu yadav

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

140 Views

The iostream::eof in a loop is considered as wrong because we haven’t reached the EOF. So it does not mean that the next read will succeed.When we want to read a file using file streams in C++. And when we use a loop to write in a file, if we ... Read More

How to convert positive value to negative while inserting in MySQL?

Chandu yadav

Chandu yadav

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

1K+ Views

Let us first create a tablemysql> create table recordsDemo    -> (    -> UserId int,    -> Value int    -> ); Query OK, 0 rows affected (0.52 sec)Now insert some records in the table using insert command.The query is as followsmysql> insert into recordsDemo values(1, 10); Query OK, ... Read More

Advertisements