Anvi Jain has Published 629 Articles

How to redirect website after certain amount of time without JavaScript?

Anvi Jain

Anvi Jain

Updated on 08-Jan-2020 07:06:18

4K+ Views

To redirect from an HTML page, use the META Tag. With this, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value of the content is the number of seconds; you want the page to redirect after.Through this, you can automatically redirect ... Read More

Using SQL statements in ABAP Programming and Database performance

Anvi Jain

Anvi Jain

Updated on 18-Dec-2019 07:57:43

186 Views

The basic principle for performance is that there should be minimal data transferred between application server and database.For your first question, I would suggest to select only the fields that are required. So, don’t use SELECT * in case you don’t require all the fields. But in specific scenarios, if ... Read More

What are the differences between JavaScript and PHP cookies?

Anvi Jain

Anvi Jain

Updated on 03-Oct-2019 08:09:22

576 Views

JavaScript CookiesUsing JavaScript cookies is the most efficient method of remembering and tracking preferences, purchases, commissions, and other information required for better visitor experience or site statistics.PHP CookiesCookies are text files stored on the client computer and they are kept for tracking purpose. PHP transparently supports HTTP cookies.How JavaScript cookies ... Read More

Implement Conditional MySQL Query in a stored procedure?

Anvi Jain

Anvi Jain

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

532 Views

For conditional MySQL query, you can use IF ELSE concept in stored procedure. Let us first create a table −mysql> create table DemoTable1    (    Id int    ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 values(10); ... Read More

How to display labels in the form of a 4 column table with GridLayout in Java?

Anvi Jain

Anvi Jain

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

752 Views

We will displays labels in a label with 5 rows and 4 columns using GridLayout −JPanel panel = new JPanel(new GridLayout(5, 4, 10, 10));Use a for loop and loop through 1 to 20 to display 20 labels −for (int i = 1; i

How to make MySQL table primary key auto increment?

Anvi Jain

Anvi Jain

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

1K+ Views

To make MySQL table primary key auto increment, use the below syntaxCREATE TABLE yourTableName    (    yourColumnName INT(6) ZEROFILL NOT NULL AUTO_INCREMENT,    PRIMARY KEY(yourColumnName)    );Let us first create a table and set primary key auto increment −mysql> CREATE TABLE DemoTable    (    UserId INT(6) ZEROFILL NOT ... Read More

How to left align components vertically using BoxLayout with Java?

Anvi Jain

Anvi Jain

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

2K+ Views

To align components vertically, use the BoxLayout −JFrame frame = new JFrame(); frame.getContentPane().setLayout(new BoxLayout(frame.getContentPane(), BoxLayout.Y_AXIS));Now, create a Panel and add some buttons to it. After that set left alignment of components which are already arranged vertically using Component.LEFT_ALIGNMENT constant −JPanel panel = new JPanel(); JButton btn1 = new JButton("One"); JButton ... Read More

C++ Program to Generate Random Partition out of a Given Set of Numbers or Characters

Anvi Jain

Anvi Jain

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

218 Views

This is a C++ program to generate Random Partition out of a given set of numbers or characters.AlgorithmBegin    Take the integers or characters as input.    For choice 1:       Take the input of the n integer array.       Assign l = 0 to traverse ... Read More

How to stop C++ console application from exiting immediately?

Anvi Jain

Anvi Jain

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

802 Views

Sometimes we have noticed that the console is being closed immediately after displaying the result. So we cannot see the result properly. Here we will see how we can stop the console from closing.The idea is very simple. We can use the getchar() function at the end. This will wait ... Read More

How to center a Window in Java?

Anvi Jain

Anvi Jain

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

742 Views

To center a Window in Java, use the getCenterPoint() method. Set the width and height and use the below formulae to set bounds −Point center = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint(); int width = 500; int height = 200; frame.setBounds(center.x - width / 2, center.y - height / 2, width, height);The following is an ... Read More

Advertisements