Select Particular Range of Values in a MySQL Table

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

835 Views

In order to select particular range of values in a MySQL table, you can use WHERE clause. Let us first create a table:mysql> create table DemoTable (    CustomerId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    CustomerName varchar(200),    CustomerAge int,    isRegularCustomer bool ); Query OK, 0 rows affected (0.57 sec)Following is the query to insert some records in the table using insert command:mysql> insert into DemoTable(CustomerName, CustomerAge, isRegularCustomer)values('Chris', 24, true); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable(CustomerName, CustomerAge, isRegularCustomer)values('Robert', 26, false); Query OK, 1 row affected (0.22 sec) mysql> insert into DemoTable(CustomerName, CustomerAge, isRegularCustomer)values('Mike', ... Read More

Difference Between Synchronized ArrayList and CopyOnWriteArrayList in Java

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

1K+ Views

Synchronized ArrayList and CopyOnWriteArrayList are useful for synchronizing the ArrayList. This is necessary for a multi-threaded environment to make sure thread safety is achieved.The differences between Synchronized ArrayList and CopyOnWriteArrayList are given as follows −Synchronized ArrayListCopyOnWriteArrayListSynchronized ArrayList is used to synchronize the ArrayList.CopyOnWriteArrayList is used to synchronize the ArrayList.The Java 1.2 version first introduced the Synchronized ArrayList.The Java 1.5 version first introduced the CopyOnWriteArrayList.The Synchronized ArrayList should be used when there are more write operations than reading operations in ArrayList.The CopyOnWriteArrayList should be used when there are more read operations than write operations in ArrayList.This iterator is a fail-fast iterator.This ... Read More

Subtract Two 8-Bit BCD Numbers in 8086

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

2K+ Views

In this program we will see how to subtract two 8-bit BCD numbers.Problem StatementWrite 8086 Assembly language program to subtract two 8-bit BCD number stored in memory address offset 600.DiscussionThis task is too simple. Here we are taking the numbers from memory and after adding we need to put DAS instruction to adjust the accumulator content to decimal form after the subtraction operation. The DAS will check the AC and CY flags to adjust a number to its decimal form.InputAddressData……5009950125…… Flow Diagram Program OutputAddressData……6007460100……

Sort Inner Array in MongoDB

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

3K+ Views

You can achieve this with the help of aggregate framework in MongoDB. To understand it, let us create a collection with document. The query to create a collection with document is as follows:> db.sortInnerArrayDemo.insertOne( ... ...    { ...       "EmployeeDetails": ...       { ...          "EmployeeAddress": ...          { ...             "EmployeeCountry": ...             [ ...                { ...                   "EmployeeZipCode":1003, ...       ... Read More

What is a PageContext Object in JSP

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

1K+ Views

The pageContext object is an instance of a javax.servlet.jsp.PageContext object. The pageContext object is used to represent the entire JSP page.This object is intended as a means to access information about the page while avoiding most of the implementation details.This object stores references to the request and response objects for each request. The application, config, session, and out objects are derived by accessing attributes of this object.The pageContext object also contains information about the directives issued to the JSP page, including the buffering information, the errorPageURL, and page scope.The PageContext class defines several fields, including PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, and APPLICATION_SCOPE, ... Read More

Get Hour Using LocalTime in Java

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

678 Views

The hour of the day for a particular LocalTime can be obtained using the getHour() method in the LocalTime class in Java. This method requires no parameters and it returns the hour of the day which can range from 0 to 23.A program that demonstrates this is given as followsExample Live Demoimport java.time.*; public class Demo {    public static void main(String[] args) {       LocalTime lt = LocalTime.parse("15:28:35");       System.out.println("The LocalTime is: " + lt);       System.out.println("The hour is: " + lt.getHour());    } }outputThe LocalTime is: 15:28:35 The hour is: 15Now let us ... Read More

Get Days from Period in Java

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

388 Views

The number of days for a particular Period can be obtained using the getDays() method in the Period class in Java. This method requires no parameters and it returns the number of days in the Period.A program that demonstrates this is given as followsExample Live Demoimport java.time.Period; public class Demo {    public static void main(String[] args) {       String period = "P5Y7M15D";       Period p = Period.parse(period);       System.out.println("The Period is: " + p);       System.out.println("The number of days are: " + p.getDays());    } } OutputThe Period is: P5Y7M15D The ... Read More

Link Control Protocol (LCP)

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

6K+ Views

Link Control Protocol (LCP) is a part of Point – to – Point Protocol (PPP) that operates in the data link layer. It is responsible for establishing, configuring, testing, maintaining and terminating links for transmission. It also imparts negotiation for set up of options and use of features by the two endpoints of the links.Working PrincipleWhen PPP tries to communicate, it sends out LCP packets prior to the establishment of connections over the point – to – point link. The LCP packets check the communication line to ascertain whether it can sustain the data volume at the required speed. Accordingly, ... Read More

Multiset Insert Function in C++ STL

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

235 Views

The multiset insert() function in C++ STL which insert elements in the multiset container from a position to another position from one multiset to a different multiset.List of functions used:ms.size() = Returns the size of multiset. ms.insert() = It is used to insert elements to the multiset.Example Code#include #include #include #include using namespace std; int main() {    multiset ms;    multiset::iterator it, it1;    int c, i;    while (1) {       cout

Find Current Row of ResultSet Object Using JDBC

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

723 Views

The getRow() method of the ResultSet class returns the row number at which the ResultSet pointer exists in the current instance.Assume we have a table named cricketers_data with 6 records as shown below:+------------+------------+---------------+----------------+-------------+ | First_Name | Last_Name  | Date_Of_Birth | Place_Of_Birth | Country     | +------------+------------+---------------+----------------+-------------+ | Shikhar    | Dhawan     | 1981-12-05    | Delhi          | India       | | Jonathan   | Trott      | 1981-04-22    | CapeTown       | SouthAfrica | | Lumara     | Sangakkara | 1977-10-27    | Matale     ... Read More

Advertisements