Display all tables inside a MySQL database using Java?

Rishi Rathor
Updated on 30-Jul-2019 22:30:24
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 to clean a refrigerator without using harsh chemicals and costly cleaners?

Knowledge base
Updated on 30-Jul-2019 22:30:24
Cleaning a refrigerator is always a time-taking messy procedure where using chemicals and cleaners which show their drastic effect on our skin and breathing, making our day miserable. There are some natural products with which we can easily clean the refrigerator. First, we need to switch off the supply and clear the fridge by taking out all the food items. Take out the removable trays, shelves, drawers and holders for keeping it open and empty.Soap and LatherWe can use mild soap lather to clean those trays, shelves, holders, and containers. But for that use lukewarm water and mild dishwashing soap/powder/liquid ... Read More

Which are the budget deodorants available in Indian Market?

Ridhi Arora
Updated on 30-Jul-2019 22:30:24
Good fragrance attracts everyone and to keep yourself in good odor there are so many deodorants available in the market. While some people love to experiment with different brands others stick to fragrant soaps as they do not know which brands of deodorants they can go with. The list below might help in this case.1. Eva: This brand is particularly famous for feminine fragrance such as lavender etc.2. Wildstone: This is explicitly costlier, but when bought along with perfume, the combo as a whole is cheaper. It is available even in the fragrances desired by both women and men.3. Fog: ... Read More

What is Methanol and why is it considered an alternative cooking fuel?

Vihan Rodrigues
Updated on 30-Jul-2019 22:30:24
Methanol is a clean burning drop in fuel and can replace both petrol, and diesel in transportation and LPG, wood, kerosene in cooking fuel.Why Is Methanol Essential?To sustain our energy needs in the future, alternative forms of energy is the only way out. Methanol will not just mitigate the environmental hazards, but also will help households reduce their fuel costs, and thus make more savings.How Would It Be Capitalised?Assam Petrochemicals Ltd to roll out country’s first methanol-based cooking fuel, which will be 30% cheaper than the conventional LPG fuel. It’s cleaner, greener and easily transportable. After China and Israel already ... Read More

Using run-time polymorphism in Java

Rishi Raj
Updated on 30-Jul-2019 22:30:24
A single action can be performed in multiple ways using the concept of polymorphism. Run-time polymorphism can be performed by method overriding. The overridden method in this is resolved at compile time.A program that demonstrates run-time polymorphism in Java is given as follows:Example Live Democlass Animal {    void sound() {       System.out.println("Animal makes sound");    } } class Cat extends Animal {    void sound() {       System.out.println("Cat Meows");    } } class Dog extends Animal {    void sound() {       System.out.println("Dog Barks");    } } class Cow extends Animal {    void ... Read More

Do whatsapp emoticons depict all our emotions perfectly?

Ridhi Arora
Updated on 30-Jul-2019 22:30:24
Whatsapp is a boon, especially to the young generations nowadays due to the features it holds like Voice call, video calls, chat options, etc. Not only this, but the emoticons are also marvellously in trend.Emoticons: These are simple and cute pictures which are used to depict your emotions. Some of these smileys are really meaningful and make quite a lot of sense while the others are just to confuse and overwhelm too.Do They Really Comprise All Emotions?Well, it depends on the symbol that was used. Every emotion has its own meaning. For example, the smile emoticons state that you are ... Read More

Datetime to Integer in MySQL?

Arjun Thakur
Updated on 30-Jul-2019 22:30:24
In MySQL, convert datetime to integer using UNIX_TIMESTAMP() function. The syntax is as follows:SELECT UNIX_TIMESTAMP(yourDatetimeColumnName) as anyVariableName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table DatetimeToInteger    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> ArrivalTime datetime,    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (0.94 sec)Insert some records in the table using insert command. The query is as follows:mysql> insert into DatetimeToInteger(ArrivalTime) values(now()); Query OK, 1 row affected (0.09 sec) mysql> insert into DatetimeToInteger(ArrivalTime) values(curdate()); Query OK, 1 ... Read More

Ranbir Kapoor: When you fall in love, even water tastes like sherbet

Prasanna Kotamraju
Updated on 30-Jul-2019 22:30:24
"Every time I see you, I fall in love all over again, " says Ranbir to Alia. This filmy couple is breathing new life into their relationship and giving heart throbbing news to the media every day.Ranbir and Alia who are at the peak of their careers are allegedly dating which has become the biggest Bollywood news. Alia is basking in the grand success of Raazi while Ranbir is all gearing up for his much-awaited biopic 'Sanju'. The duo is currently working on Ayan Mukerji’s next film 'Brahmastra', which also stars Amitabh Bachchan.Apart from being the most happening stars of ... Read More

Clone IdentityHashMap in Java

Samual Sam
Updated on 30-Jul-2019 22:30:24
To clone the IdentityHashMap in Java, use the clone() method.Create an IdentityHashMap and add elements to it −IdentityHashMap m = new IdentityHashMap(); m.put("1", 100); m.put("2", 200); m.put("3", 300); m.put("4", 150); m.put("5", 110);Now get the size of the IdentityHashMap −m.size()The following is an example to clone IdentityHashMap in Java −Example Live Demoimport java.util.*; public class Demo {    public static void main(String[] args) {       IdentityHashMap m = new IdentityHashMap();       m.put("1", 100);       m.put("2", 200);       m.put("3", 300);       m.put("4", 150);       m.put("5", 110);       m.put("6", 50); ... Read More

Why is the atmosphere much rarer on the moon than on the earth?

Knowledge base
Updated on 30-Jul-2019 22:30:24
The atmosphere on the moon is much rarer and the temperatures on the moon are extreme ranging from boiling hot to freezing cold depending on the area of moon’s surface exposed to sunlight. The atmospheric gases on the moon are very much rarer on the moon.As moon rotates on its axis in about 27 days, lunar day-time is about 13.5 earth days and lunar night-time is about 13.5 earth nights. The lunar atmosphere varies depending upon these lunar day and night times also.The gases on the earth remain in the earth’s atmosphere because of the gravitational pull acting on. These ... Read More
Advertisements