Anvi Jain has Published 569 Articles

Write a program to get the list of all the supported datatypes in JDBC?

Anvi Jain

Anvi Jain

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

187 Views

The class named Types of the java.sql package contains the constants that represents the SQL datatypes. All these datatypes are represented by unique integer values.Retrieving the integer values from the Types classTo print all the class names and values of the constants in java.sql.Types class −Retrieve all the fields in ... Read More

How to Create a Reminder Notification in Android?

Anvi Jain

Anvi Jain

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

4K+ Views

This example demonstrate about How to Create a Reminder Notification in AndroidStep 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

How to set font face, style, size and color for JTextPane text in Java

Anvi Jain

Anvi Jain

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

1K+ Views

For background and foreground color of the JTextPane, use the following −JTextPane textPane = new JTextPane(); textPane.setBackground(Color.blue); textPane.setBackground(Color.green);For font face, style and size, use the Font class and set the font −Font font = new Font("Serif", Font.ITALIC, 18); textPane.setFont(font);The following is an example to set font, style and color for ... Read More

How to execute a task repeatedly after fixed time intervals in iOS

Anvi Jain

Anvi Jain

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

294 Views

Apple has predefined class Timer, that fires after a certain time interval has elapsed, sending a specified message to a target object.To read more about the Timer class you can check official apple documentation herehttps://developer.apple.com/documentation/foundation/timerTo execute the task repeatedly after fixed interval of time we are going to use timer ... Read More

How to implement an Android notification action without opening the app?

Anvi Jain

Anvi Jain

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

1K+ Views

This example demonstrate about How to implement an Android notification action without opening the app.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

Getting only the first item for an array property in MongoDB?

Anvi Jain

Anvi Jain

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

424 Views

Use $slice operator for this. Let us first create a collection with documents −> db.gettingFirstItemInArrayDemo.insertOne(    {       "UserId": 101,       "UserName":"Carol",       "UserOtherDetails": [          {"UserFriendName":"Sam"},          {"UserFriendName":"Mike"},          {"UserFriendName":"David"},         ... Read More

What is the MySQL datatype to store DATALINK object in JDBC

Anvi Jain

Anvi Jain

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

427 Views

A DATALINK object represents an URL value which refers to an external resource (outside the current database/data source), which can be a file, directory etc..MySQL does not provide any separate datatype to store DATALINK/URL value you need to store using TEXT or VARCHAR datatypes as shown in the following query ... Read More

Is POW() better or POWER() in MySQL?

Anvi Jain

Anvi Jain

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

198 Views

Both pow() and power() are synonyms. Let us see the syntax −select pow(yourValue1, yourValue2); OR select power(yourValue1, yourValue2);Now we will see some examples.Using pow()mysql> select POW(4, 3);This will produce the following output −+----------+ | POW(4, 3) | +----------+ | 64 | +----------+ ... Read More

How to retrieve binary data from a table using JDBC?

Anvi Jain

Anvi Jain

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

961 Views

SQL databases provide a datatype named Blob (Binary Large Object) in this, you can store large binary data like images.To retrieve binary (stream) values from a table JDBC provides a method called getBinaryStream() in the PreparedStatement interface.It accepts an integer representing the index of the column of the table and ... Read More

MongoDB query to exclude both the fields with FALSE

Anvi Jain

Anvi Jain

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

391 Views

Use $or operator along with $expr operator for this. Let us first create a collection with documents, wherein one of fields is isMarried having true of false value −> db.orTwoFieldsDemo.insertOne({"isLiveInUS":true, "isMarried":false}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cdfd86abf3115999ed5120d") } > db.orTwoFieldsDemo.insertOne({"isLiveInUS":true, "isMarried":true}); {    "acknowledged" : true,   ... Read More

Advertisements