Anvi Jain has Published 569 Articles

Difference between set, multiset, unordered_set, unordered_multiset in C++

Anvi Jain

Anvi Jain

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

346 Views

Here we will see what are the differences for set, multiset, unordered_set and unordered_multiset in C++. Let us see the properties of them using some example.SetThe properties of set are like belowStores data in sorted orderStores only unique valuesWe can insert or delete data, but cannot change the dataWe can ... Read More

Is it Possible to store and retrieve boolean values in a VARCHAR2 column in a table using JDBC?

Anvi Jain

Anvi Jain

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

597 Views

Yes, in Oracle you can store and retrieve a boolean value into a table for a column with VARCHAR2 datatype.If you do so, the true and false values are stored as 1 and 0 and the retrieved as same (respectively).ExampleLet us create a table with name sampleTable in the Oracle ... Read More

How to define aliases in the MongoDB Shell?

Anvi Jain

Anvi Jain

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

209 Views

To define aliases in MongoDB shell, you can use below syntax −Object.defineProperty(this, 'yourFunctionName', {    get: function() {       yourStatement1,       .       .       return N    },    enumerable: true,    configurable: true });Following is the syntax to assign ... Read More

How to set the location of the Tabs in a JTabbedPane Container to the left in Java?

Anvi Jain

Anvi Jain

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

744 Views

To set the location of the tabs in a JTabbedPane container, use the LEFT constant. Here, we will set the position to the left −JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.LEFT);The following is an example to set the location of the Tabs in a JTabbedPane Container to the left −Examplepackage my; import ... Read More

How to create a table with decimal values using JDBC?

Anvi Jain

Anvi Jain

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

762 Views

An unpacked floating-point number that cannot be unsigned. In the unpacked decimals, each decimal corresponds to one byte. Defining the display length (M) and the number of decimals (D) is required. NUMERIC is a synonym for DECIMAL.To define a column with a decimal value as datatype follow the syntax given ... Read More

Find all documents that have two specific id's in an array of objects in MongoDB?

Anvi Jain

Anvi Jain

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

126 Views

You can use $and operator for this. Let us first create a collection with documents −> db.twoSpecificIdsDemo.insertOne( ...   { ...      PlayerId:1, ...      "PlayerDetails": [{ ...         id: 100, ...         "PlayerName":"Chris" ...      }, { ...     ... Read More

Fesetround() and fegetround() in C++

Anvi Jain

Anvi Jain

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

127 Views

Here we will see the fesetround() and fegetround() method in C++. These methods can be found in the cfenv library.The fesetround() method is used to set the specified floating point rounding direction to the current rounding direction. This is used with rint(), nearbyint() and some other rounding functions in C++.The ... Read More

How to clear an Android notification if activity crashes?

Anvi Jain

Anvi Jain

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

238 Views

This example demonstrate about How to clear an Android notification if activity crashesStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 ... Read More

Batch Inserts Using JDBC Statements

Anvi Jain

Anvi Jain

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

384 Views

Grouping a set of INSERT Statements and executing them at once is known as batch insert.Batch inserts using Statement objectTo execute a batch of insert statements using the Statement object −Add statements to the batch − Prepare the INSERT quires one by one and add them to batch using the ... Read More

Query to retrieve multiple items in an array in MongoDB?

Anvi Jain

Anvi Jain

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

172 Views

To retrieve multiple items in an array, use aggregate framework. Let us first create a collection with documents −> db.retrieveMultipleDemo.insertOne( ...   { ...      "UserDetails": ...      [ ...         { "_id": "101", "UserName":"John", "UserAge": 23 }, ...         { "_id": ... Read More

Advertisements