What is the use of setBounds() method in Java?

raja
Published on 10-Jul-2019 22:47:44
The layout managers are used to automatically decide the position and size of the added components. In the absence of a layout manager, the position and size of the components have to be set manually. The setBounds() method is used in such a situation to set the position and size. To specify the ... Read More

What are the differences between an event listener interface and an event adapter class in Java?

raja
Published on 10-Jul-2019 21:31:06
An EventListener interface defines the methods that must be implemented by an event handler for a particular kind of an event whereas an Event Adapter class provides a default implementation of an EventListener interface.Event ListenerThe Event Listeners are the backbone of every component to handle the events.Every method of a particular EventListener will have a single parameter ... Read More

What is the importance of _.union() method in JavaScript?

vineeth.mariserla
Published on 10-Jul-2019 18:48:52
_.union()_.Union() method belongs to underscore.js a library of javascript. The _.union() function is used to take n number of arrays and return a new array with the unique terms in all those arrays (union of all array). It scrutinizes each and every value of the arrays and pushes out unique values into ... Read More

Fix Error with TYPE=HEAP for temporary tables in MySQL?

Sharon Christine
Published on 10-Jul-2019 18:06:03
The TYPE=HEAP deprecated in newer MySQL versions. You can use ENGINE=HEAP instead of TYPE. Following is the syntax −ENGINE=HEAP;Let us first create a table. Here, we have set Engine=HEAP −mysql> create TEMPORARY table DemoTable    -> (    -> StudentId int,    -> StudentName varchar(30)    -> )Engine = HEAP; ... Read More

How to place number 0 from a column at the end maintaining the ascending search order in MySQL?

Sharon Christine
Published on 10-Jul-2019 18:04:09
Let us first create a table −mysql> create table DemoTable    -> (    -> Number int    -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(9); Query OK, 1 row affected (0.13 sec) mysql> insert ... Read More

How to order by timestamp in MySQL?

karthikeya Boyini
Published on 10-Jul-2019 18:01:14
To order by timestamp, use the ORDER BY as in the following syntax −select *from yourTableName ORDER BY STR_TO_DATE(`yourColumnName`, '%m/%d/%Y%h:%i:%s %p');Let us first create a table −mysql> create table DemoTable    -> (    -> `timestamp` varchar(100)    -> ); Query OK, 0 rows affected (0.56 sec)Insert some records in ... Read More

Add a new column and set values in it on the basis of conditions in MySQL?

karthikeya Boyini
Published on 10-Jul-2019 17:58:22
To set values on the basis of conditions, use IF() method. Let us first create a table −mysql> create table DemoTable    -> (    -> Age int    -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert command −mysql> insert into DemoTable ... Read More

Select multiple columns and display in a single column in MySQL?

karthikeya Boyini
Published on 10-Jul-2019 17:55:31
Use concat() for this. Let us first create a table −mysql> create table DemoTable    -> (    -> FirstName varchar(30),    -> LastName varchar(30)    -> ); Query OK, 0 rows affected (0.49 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris', 'Brown'); Query ... Read More

MySQL query to delete row

karthikeya Boyini
Published on 10-Jul-2019 17:51:08
Use the DELETE to delete a row in MySQL. Let us first create a table −mysql> create table DemoTable    -> (    -> CustomerId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> CustomerName varchar(100),    -> CustomerAge int    -> ); Query OK, 0 rows affected (1.30 sec)Insert some ... Read More

Get the difference between dates and calculate salary with MySQL?

karthikeya Boyini
Published on 10-Jul-2019 17:49:08
Let’s say you need to get the difference between dates (JoiningDate – EndDate) of a month i.e. days to calculate the salary. The daily-wage salary is let’s say 300; therefore for 20 days, it will 6000. In the same way, for 27 days, it will be 8100.For our example, let ... Read More
Advertisements