Chandu yadav has Published 1091 Articles

How to Drop MySQL Table using Java?

Chandu yadav

Chandu yadav

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

273 Views

Let us first create a table in a database. The query to create a table is as followsmysql> create table customerDetails    -> (    -> CustomerId int,    -> CustomerName varchar(30)    -> ); Query OK, 0 rows affected (0.56 sec)Now display all tables from the database in order ... Read More

MySQL appears to DROP USER but user still exists in MySQL.users table?

Chandu yadav

Chandu yadav

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

164 Views

First check all the user and host from MySQL.user table with the help of select statement as shown belowmysql> select user, host from MySQL.user;The following is the output+------------------+-----------+ | user             | host      | +------------------+-----------+ | Bob             ... Read More

8086 program to divide a 16 bit number by an 8 bit number

Chandu yadav

Chandu yadav

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

13K+ Views

In this program we will see how to divide 16-bit number by an 8-bit number.Problem StatementWrite 8086 Assembly language program to divide 16-bit number stored in memory location offset 501. Divide it with 8-bit number stored in 500H. Also store result at memory offset 600.Discussiont8086 has DIV instruction to perform ... Read More

What is LabelValue class in JavaTuples?

Chandu yadav

Chandu yadav

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

162 Views

A LabelValue class is a Tuple of 2 elements with label as the first position, whereas value as the second. It is in the JavaTuples library. The LabelValue Tuple class is Typesafe, Immutable, Iterable, Serializable, etc.The following is the declaration of the LabelValue class;public final class LabelValue extends Tuple implements IValueLabel, ... Read More

How do I find all documents with a field that is NaN in MongoDB?

Chandu yadav

Chandu yadav

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

1K+ Views

To find all documents with a field that is NAN in MongoDB, use the following syntaxdb.yourCollectionName.find( { yourFieldName: NaN })Let us first create a collection with documents> db.nanDemo.insertOne({"Score":0/0}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca251a26304881c5ce84b8a") } > db.nanDemo.insertOne({"Score":10/5}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca2520e6304881c5ce84b8b") } ... Read More

How to handle error object in JSP using JSTL tags?

Chandu yadav

Chandu yadav

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

594 Views

You can make use of JSTL tags to write an error page ShowError.jsp with better structure and more information −           Show Error Page               Opps...                     ... Read More

MySQL query to calculate the average of values in a row?

Chandu yadav

Chandu yadav

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

370 Views

To calculate the average of values in a row in MySQL, use the following syntaxSELECT (yourTableName.yourColumnName1+yourTableName.yourColumnName2+yourTableName.yourColumnName3+, ..........N)/numberOfColumns AS anyAliasName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table calculateAverageDemo    -> (    -> x int,   ... Read More

How to find and modify a value in a nested array?

Chandu yadav

Chandu yadav

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

221 Views

To find and modify a value in a nested array, you can use update command. Let us first create a collection with documents> db.findAndModifyAValueInNestedArrayDemo.insertOne( { "CompanyName" : "Amazon", "DeveloperDetails" : [ { "ProjectName" : "Online Book Store", "TeamSize" : "5" }, { "ProjectName" : "Library Management System", "TeamSize" : "7" ... Read More

Can we use stored procedure to insert records into two tables at once in MySQL?

Chandu yadav

Chandu yadav

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

495 Views

Yes, you can use stored procedure to insert into two tables in a single query. Let us first create a table −mysql> create table DemoTable (    StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentFirstName varchar(20) ); Query OK, 0 rows affected (0.56 sec)Here is the query to create ... Read More

ArrayBlockingQueue drainTo() Method in Java

Chandu yadav

Chandu yadav

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

218 Views

The drainTo() method of the ArrayBlockingQueue class removes all available elements from this queue and adds them to the given collection. It returns the number of elements transferred.The syntax is as followsint drainTo(Collection

Advertisements