- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Nishtha Thakur has Published 564 Articles
Nishtha Thakur
111 Views
Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Number int ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert command −mysql> insert ... Read More
Nishtha Thakur
794 Views
You can use $in operator for this. Let us first create a collection with documents −> db.searchForStringOrNumberDemo.insertOne( { "_id": new ObjectId(), "StudentName": "Larry", "StudentDetails": { "StudentMarks": { "StudentMongoDBMarks": [44] ... Read More
Nishtha Thakur
114 Views
You can create a table in a database using the CREATE TABLE query.SyntaxCREATE TABLE table_name( column1 datatype, column2 datatype, column3 datatype, ..... columnN datatype, PRIMARY KEY( one or more columns ) );To create a table in a database using JDBC API you need to −Register the driver − Register the ... Read More
Nishtha Thakur
313 Views
To format text in JTextPane, use the SimpleAttributeSet and StyleConstants class. This allows you to set the style of text, background color, foreground color, etc.At first, create a new JTextPane −JTextPane pane = new JTextPane();Now, use the classes to set the style and color −SimpleAttributeSet attributeSet = new SimpleAttributeSet(); StyleConstants.setItalic(attributeSet, ... Read More
Nishtha Thakur
109 Views
To set a pecific date format, you need to use DATE_FORMAT() in MySQL. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, ArrivalDate date ); Query OK, 0 rows ... Read More
Nishtha Thakur
2K+ Views
Notifications communicate important information to users of your app, regardless of whether your app is running on the user's device.For example, a sports app can let the user know when their favourite team scores. Notifications can also tell your app to download information and update its interface. Notifications can display ... Read More
Nishtha Thakur
709 Views
To set style for text in JTextPane, use setItalic() or setBold() that sets italic or bold style for font respectively.Following is our JTextPane component −JTextPane pane = new JTextPane();Now, use the StyleConstants class to set style for the JTextPane we created above. We have also set the background and foregound ... Read More
Nishtha Thakur
248 Views
You can’t directly update _id field i.e. write some script to update. Let us first create a collection with documents −> db.updatingIdFieldDemo.insertOne({"StudentName":"Chris"}); { "acknowledged" : true, "insertedId" : ObjectId("5ce271bb36e8b255a5eee949") }Following is the query to display all documents from a collection with the help of find() method −> db.updatingIdFieldDemo.find();This ... Read More
Nishtha Thakur
225 Views
Let us first create a table −mysql> create table DemoTable ( UserId int, UserName varchar(20), UserAge int ); Query OK, 0 rows affected (0.53 sec)Insert some records in the table using insert command −mysql> insert ... Read More
Nishtha Thakur
190 Views
To highlight all the text, use the selectAll() method of the JTextPane component −JTextPane pane = new JTextPane(); pane.selectAll();The following is an example to highlight the JTextPane text. Here, we are displaying a code in the JTextPane and highlighting it −Examplepackage my; import java.awt.BorderLayout; import java.awt.Container; import javax.swing.JFrame; import javax.swing.JScrollPane; ... Read More