Nishtha Thakur has Published 564 Articles

Hiding of all overloaded methods in base class in C++

Nishtha Thakur

Nishtha Thakur

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

426 Views

In C++, we can use the function overloading techniques. But if some base class has one method in overloaded form (different function signature with the same name), and the derived class redefines one of the function which is present inside the base, then all of the overloaded version of that ... Read More

Batch Inserts Using JDBC Prepared Statements

Nishtha Thakur

Nishtha Thakur

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

4K+ Views

Grouping a set of INSERT Statements and executing them at once is known as batch insert.Batch inserts using PreparedStatement objectTo execute a batch of insert statements using the PreparedStatement object −Create a PreparedStatement − Create a PreparedStatement object using the prepareStatement() method. Pass the Insert query with place holders “?” ... Read More

How to search for documents based on the value of adding two properties in MongoDB?

Nishtha Thakur

Nishtha Thakur

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

57 Views

You can use aggregate framework for this. Here, we will get the sum and then match it to search for documents less than a particular number. Let us first create a collection with documents −> db.searchDocumentsDemo.insertOne({"Value1":100, "Value2":560}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd3fe1eedc6604c74817ce9") } > db.searchDocumentsDemo.insertOne({"Value1":300, "Value2":150}); ... Read More

How to set Large icon instead of small icon on Android Notification?

Nishtha Thakur

Nishtha Thakur

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

2K+ Views

This example demonstrate about How to set Large icon instead of small icon on Android Notification .Step 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. ... Read More

How to create JSplitPane to divide components in Java?

Nishtha Thakur

Nishtha Thakur

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

146 Views

At first, set two components which we will dividing −JComponent one = new JLabel("Label One"); one.setBorder(BorderFactory.createLineBorder(Color.yellow)); JComponent two = new JLabel("Label Two"); two.setBorder(BorderFactory.createLineBorder(Color.orange));Now, split it using SplitPane −Examplepackage my; import java.awt.BorderLayout; import java.awt.Color; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JSplitPane; public class SwingDemo {    public static ... Read More

How to get a specific object from array of objects inside specific MongoDB document?

Nishtha Thakur

Nishtha Thakur

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

363 Views

To get specific object from array of objects, use positional operator($). Let us first create a collection with documents −> db.getASpecificObjectDemo.insertOne( ...   { ...      _id :1, f ...      "CustomerName" : "Larry", ...      "CustomerDetails" : { ...         "CustomerPurchaseDescription": [{ ... ... Read More

How to give emojis support in Android push notification?

Nishtha Thakur

Nishtha Thakur

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

389 Views

This example demonstrate about How to give emojis support in Android push notificationStep 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

Add a field to an embedded document in an array in MongoDB?

Nishtha Thakur

Nishtha Thakur

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

419 Views

You can use update() along with $ operator for this. Let us first create a collection with documents −> db.addAFieldDemo.insertOne( ...   { ... ...      "ClientName" : "Larry", ...      "ClientCountryName" : "US", ...      "ClientOtherDetails" : [ ...         { ...   ... Read More

How do I check to see if a column name exists in a CachedRowSet in JDBC?

Nishtha Thakur

Nishtha Thakur

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

2K+ Views

CachedRowSet interface does not provide any methods to determine whether a particular column exists.Therefore, to find whether a RowSet contains a specific column, you need to compare the name of each column in the RowSet with the required name. To do so −Retrieve the ResultSetMetaData object from the RowSet using ... Read More

How to check if an Android app is allowed to show notification?

Nishtha Thakur

Nishtha Thakur

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

136 Views

This example demonstrate about Android NotificationBuilder.Step 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 − Add the following code to ... Read More

Advertisements