- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHPPhysics
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
Anvi Jain has Published 569 Articles
Anvi Jain
2K+ Views
The short is equivalent to MySQL’s small int. The Java short takes 2 bytes that has the range -32768 to 32767 while MySQL smallint also take 2 bytes with same range.Here is the demo code of short in Java −public class SmallIntAsShortDemo { public static void main(String[] args) { ... Read More
Anvi Jain
451 Views
Let’s say the following is our JTextArea with default text −JTextArea textArea = new JTextArea("The text added here is just for demo. " + "This demonstrates the usage of JTextArea in Java. In this example we have" + "deleted some text.");Now to remove the first 10 characters, use ... Read More
Anvi Jain
589 Views
Let us first create a collection with documents −> db.deleteMultipleDocumentsDemo.insertOne({"StudentFirstName":"Larry"}); { "acknowledged" : true, "insertedId" : ObjectId("5ce00b07bf3115999ed51214") } > db.deleteMultipleDocumentsDemo.insertOne({"StudentFirstName":"Chris"}); { "acknowledged" : true, "insertedId" : ObjectId("5ce00b0bbf3115999ed51215") } > db.deleteMultipleDocumentsDemo.insertOne({"StudentFirstName":"David"}); { "acknowledged" : true, "insertedId" : ObjectId("5ce00b0fbf3115999ed51216") } > db.deleteMultipleDocumentsDemo.insertOne({"StudentFirstName":"Bob"}); { "acknowledged" : ... Read More
Anvi Jain
6K+ Views
Clob datatypeCLOB stands for Character Large Object. in general, an SQL Clob is a built-in datatype which is used to store large amount of textual data. Using this datatype, you can store data up to 2, 147, 483, 647 characters. MYSQL database provides support Clob datatype TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT.The ... Read More
Anvi Jain
208 Views
For this, use the aggregate framework. Let us first create a collection with documents −> db.aggregateArrayDemo.insertOne( { "_id":100, "UserDetails": [ { "UserName": "John", "UserLoginYear":2010 ... Read More
Anvi Jain
1K+ Views
The java.sql.DriverManager class manages JDBC drivers in your application. This class maintains a list of required drivers and load them whenever it is initialized.Therefore, you need to register the driver class before using it. However, you need to do it only once per application.One way to register a driver class ... Read More
Anvi Jain
265 Views
To replace the first 10 character in text area, use the replaceRange() method in Java and replace the old text with the new text.Let’s say the following is oude demo text set with JTextArea −JTextArea textArea = new JTextArea("This is a text displayed for our example. We have replaced some ... Read More
Anvi Jain
742 Views
You can use CASE statement for this. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Value1 int, Value2 int ); Query OK, 0 rows affected (0.76 sec)Insert some records in the table using insert command ... Read More
Anvi Jain
1K+ Views
Apple provides backgroundColor which is an instance property, Changes to this property can be animated. The default value is nil, which results in a transparent background color.To make background 25% transparent we should set the view to the UIColor with alpha 0.25view.backgroundColor = UIColor(white: 1, alpha: 0.25)You can write the following ... Read More
Anvi Jain
482 Views
Use aggregate framework along with $literal operator. Let us first create a collection with documents −> db.replaceValueDemo.insertOne( { _id : 100, "EmployeeName" :"Chris", "EmployeeOtherDetails": { "EmployeeDesignation" : "HR", "EmployeeAge":27 ... Read More