Ankith Reddy has Published 1070 Articles

How to read form data using JSP via POST Method?

Ankith Reddy

Ankith Reddy

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

3K+ Views

Below is the main.jsp JSP program to handle the input given by web browser using the GET or the POST methods.Infact there is no change in the above JSP because the only way of passing parameters is changed and no binary data is being passed to the JSP program. File ... Read More

Get the sum of multiple row (not all) values from a MySQL table?

Ankith Reddy

Ankith Reddy

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

722 Views

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

How to use a filter in JSP?

Ankith Reddy

Ankith Reddy

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

495 Views

Following example shows how to print the client's IP address and the current date time, each time it would access any JSP file. This example will give you a basic understanding of the JSP Filter, but you can write more sophisticated filter applications using the same concept −// Import required ... Read More

Floor the decimal values in MySQL instead of round?

Ankith Reddy

Ankith Reddy

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

130 Views

You can use TRUNCATE() method to floor the values instead of round. Let us first create a table −mysql> create table DemoTable (    Value DECIMAL(20, 8) ); Query OK, 0 rows affected (0.54 sec)Insert records in the table using insert command −mysql> insert into DemoTable values(23.5654433); Query OK, 1 ... Read More

How can I profile C++ code running on Linux?

Ankith Reddy

Ankith Reddy

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

341 Views

In Linux platform there are many great profiling tools for profiling C++ programs. Valgrind is one of them. It is widely used. It is a programming tool for memory debugging, memory leak detection, and profiling. We can use Valgrind by passing the binary to it and setting the tool to ... Read More

The contains() method of CopyOnWriteArrayList in Java

Ankith Reddy

Ankith Reddy

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

80 Views

The contains() method of the CopyOnWriteArrayList class is used to get the specified element. It returns TRUE if the element is in the List, else FALSE is returned.The syntax is as followsboolean contains(Object ob)Here, ob is the element to be checked for existence. To work with CopyOnWriteArrayList class, you need ... Read More

8086 program to search a number in a string

Ankith Reddy

Ankith Reddy

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

2K+ Views

In this program we will see how to find a number n from a string (an array of numbers).Problem StatementWrite 8086 Assembly language program to find a number in a string (an array of numbers). The numbers are stored at memory offset 600 onwards.DiscussionIn this program we are taking only ... Read More

How to convert date YYYYMMDD to YY-MM-DD in MySQL query?

Ankith Reddy

Ankith Reddy

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

2K+ Views

To convert date YYYYMMDD to YY-MM-DD in MySQL, use the below syntax −select date_format(str_to_date(yourColumnName, '%Y%m%d'), '%Y-%m-%d') from yourTableName;Let us first create a table −mysql> create table DemoTable (    ClientId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    ClientProjectDeadline varchar(200) ); Query OK, 0 rows affected (0.57 sec)Insert some records in ... Read More

Precedence of postfix ++ and prefix ++ in C/C++

Ankith Reddy

Ankith Reddy

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

1K+ Views

Here we will see the precedence of postfix++ and prefix++ in C or C++. The precedence of prefix ++ or -- has higher priority than dereference operator ‘*’ and postfix ++ or -- has priority higher than both prefix ++ and dereference operator ‘*’.When ptr is a pointer, then *ptr++ ... Read More

Resolve the error Column count doesn’t match value count in MySQL?

Ankith Reddy

Ankith Reddy

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

631 Views

This type of error occurs when number of columns does not match whenever you are inserting records in the destination table. For a demo example, let us create a tablemysql> create table errorDemo    -> (    -> User_Id int NOT NULL AUTO_INCREMENT,    -> User_Name varchar(20),    -> PRIMARY ... Read More

Advertisements