Articles on Trending Technologies

Technical articles with clear explanations and examples

Display all tables inside a MySQL database using Java?

Rishi Rathor
Rishi Rathor
Updated on 30-Jul-2019 2K+ Views

We will see here how to display all tables inside a MySQL database using Java. You can use show command from MySQL to get all tables inside a MySQL database.Let’s say our database is ‘test’. The Java code is as follows to show all table names inside a database ‘test’.The Java code is as follows. Here, connection is established between MySQL and Java −import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import com.mysql.jdbc.Connection; import com.mysql.jdbc.DatabaseMetaData; public class GetAllTables {    public static void main(String[] args) throws SQLException {       Connection conn = null;       try { ...

Read More

How can I get the current screen orientation in Android?

George John
George John
Updated on 30-Jul-2019 3K+ Views

In some situation, we need to find an android activity orientation. This example demonstrates how to integrate Android Login and registration form.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.     In the above code, we have taken a text view. According to screen orientation, text view going to update the text.Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.content.res.Configuration; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; ...

Read More

How to order records by a column in MySQL and place empty records at the end?

Anvi Jain
Anvi Jain
Updated on 30-Jul-2019 295 Views

To get order by column and place empty records at the end, use ORDER By and “is null” from MySQL. The syntax is as follows −select *from yourTableName order by if(yourColumName = ’ ’ or yourColumName is null, 1, 0), yourColumnName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table emptyCellsAtEnd    −> (    −> ProductId varchar(100)    −> ); Query OK, 0 rows affected (0.65 sec)Insert some records in the table using insert command. Some of these records are empty. The query is as follows −mysql> ...

Read More

How to renew distribution certificate for iOS?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 1K+ Views

To renew a distribution certificate on mac we’ll have to go through a series of steps mentioned below.Use spotlight to open keychain access on your macFrom keychain access menu select Certificate Assistant -> Request certificate from certificate Authority.Fill the information there like Name, email and choose “save to disk”.Click continue and save to your desired location. This will generate a .CSR file which we’ll need to upload to the developer portal while generating our certificate.Go to “developer.apple.com”, login to your account, select “Certificates, IDs & Profiles”.Go to certificates, select production and click on the “+” on the topSelect "App Store ...

Read More

What is the best answer to why do you want to switch your current job?

Vihan Rodrigues
Vihan Rodrigues
Updated on 30-Jul-2019 263 Views

Here are some of the most common and simple to explain reasons for leaving a job:The desire to learn.The desire to take on more responsibility.The desire to take on less responsibility.The desire to relocate.The desire for a career change.The desire to gain a new skill or grow a current skill.The company reorganization has led to a change in job content.The desire for a shorter commute to work.The desire to improve work/life balance.

Read More

How to convert Varchar to Double in SQL?

George John
George John
Updated on 30-Jul-2019 5K+ Views

You can convert varchar to double using CAST() function. The syntax is as follows:SELECT yourColumnName1, yourColumnName2, ......N, CAST(yourColumnName AS DECIMAL(TotalDigit, DigitAfterDecimalPoint)) anyVariableName FROM yourtableName ORDER BY anyVariableName DESC;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table VarcharToDouble    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> Name varchar(10),    -> Amount varchar(10) ,    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (0.67 sec)Insert some records in the table using insert command. The query is as follows:mysql> insert into VarcharToDouble(Name, Amount) values('John', ...

Read More

How to create NSIndexPath for TableView in iOS?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 977 Views

Index path is generally a set of two values representing row and section of a table view. Index path can be created in objective C as well as Swift as both are native language of iOS Development.IndexPathForRow is a class method in iOS. To create a index path we need to be sure about the section and row we need to create. Below are the methods of creating an Indexpath.To create an IndexPath in objective C we can use.NSIndexPath *myIP = [NSIndexPath indexPathForRow: Int inSection:Int] ;ExampleNSIndexPath *myIP = [NSIndexPath indexPathForRow: 5 inSection: 2] ;To create an IndexPath in Swift we ...

Read More

Who has delivered the fastest ball in the history of cricket?

Vihan Rodrigues
Vihan Rodrigues
Updated on 30-Jul-2019 690 Views

When we hear the fastest ball, the fierce faces of all fast bowlers and their tough looks start striking our mind. It includes Wasim Akram, Courtney Walsh, Chaminda Vaas, Umar Gul, etc. But the question still remains unanswered that who among the fast bowler fraternity has done this miracle.Well, the answer is Shoaib Akhtar who is recognized as the fastest bowler in the history of cricket by delivering an officially recorded top speed of 163.3 km/h in a pool match against England during the 2003 Cricket World Cup. Unfortunately, Akhtar did not get any wicket on the ball.Fastest Recorded Deliveries ...

Read More

What is a sonnet in English literature?

Ridhi Arora
Ridhi Arora
Updated on 30-Jul-2019 632 Views

A small lyric poem of fourteen lines is a sonnet. There are two types of Sonnets: the Italian (Petrarchan) and the English (Shakespearean).In the Italian form, There are two intrinsic divisions: the first part consists of 8 lines and the second part is of 6 lines, in all making 14 lines.Shakespearian SonnetsBut the same does not happen in Shakesperian sonnets. William Shakespeare, the ‘Bard of Avon’, is noted to have mastered at least 38 plays, 154 sonnets, two long narrative poems, and a few other verses. His popularity can be estimated by the following “He was naturally learned; he needed ...

Read More

MySQL - Changing year of dates from 2020 to 2011?

Ankith Reddy
Ankith Reddy
Updated on 30-Jul-2019 600 Views

You can change year of dates from 2020 to 2011 using SUBDATE() with INTERVAL of 9 year because there is a difference of 9 years between 2020 to 2011.The syntax is as follows:UPDATE yourTableName SET yourDateColumnName=SUBDATE(yourDateColumnName, INTERVAL 9 YEAR);To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table ChangeYearFrom2020To2011    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> ExpiryDate date,    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (0.67 sec)Insert some records in the table using insert command. The query to insert ...

Read More
Showing 60661–60670 of 61,297 articles
Advertisements