Nishtha Thakur has Published 564 Articles

Java DatabaseMetaData getMaxCursorNameLength() method with example.

Nishtha Thakur

Nishtha Thakur

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

32 Views

The getMaxCursorNameLength() method of the DatabaseMetaData interface is used to find out the maximum number of characters that the underlying database allows in the name of a cursor.This method returns an integer value, representing the maximum number of characters allowed in a cursor name. If this value is 0 it ... Read More

How can we sort a query using ORDER BY CASE WHEN REGEXP?

Nishtha Thakur

Nishtha Thakur

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

460 Views

Use regular expression along with CASE statement. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Value varchar(20)    ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into ... Read More

HTML Color Styles

Nishtha Thakur

Nishtha Thakur

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

254 Views

Colors are very important to give a good look and feel to your website.Hex Code (Hexadecimal colors representation)A hexadecimal is a 6 digit representation of a color. The first two digits (RR) represent a red value, the next two are a green value(GG), and the last are the blue value(BB).A ... Read More

Set a filter on field type to fetch MySQL columns with type text?

Nishtha Thakur

Nishtha Thakur

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

126 Views

To set a filter for type, you can use below syntax −SELECT TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE = 'yourDataTypeName';Let us implement the above syntax to show fields only with field type text −mysql> SELECT TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE = 'text';This will produce the following output −+---------------------------------------------+--------------------------------+ | ... Read More

Java DatabaseMetaData getMaxIndexLength() method with example.

Nishtha Thakur

Nishtha Thakur

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

29 Views

The getMaxIndexLength() method of the DatabaseMetaData interface is used to find out the maximum number of bytes that the underlying database allows for an index.This method returns an integer value, representing the maximum number of byes allowed in an index. If this value is 0 it indicates that there is ... Read More

HTML datetime Attribute

Nishtha Thakur

Nishtha Thakur

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

196 Views

The datetime attribute of the element is used to specify the date and time displaying when the text was inserted.Following is the syntax −Above, the attribute datatime displays the datetime when the text was inserted in the following format −YYYY - yearMM - monthDD - day of the monthhh ... Read More

How to add Icon to JButton in Java?

Nishtha Thakur

Nishtha Thakur

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

19K+ Views

To add icon to a button, use the Icon class, which will allow you to add an image to the button.We are creating a button wherein we are adding an icon with Icon class −Icon icon = new ImageIcon("E:\editicon.PNG"); JButton button7 = new JButton(icon);Above, we have set icon for button ... Read More

How to get MySQL combined field result?

Nishtha Thakur

Nishtha Thakur

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

114 Views

You can use CONCAT() function from MySQL for this. Let us first create a table −mysql> create table DemoTable    (    ClientId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    ClientFirstName varchar(20),    ClientLastName varchar(20)    ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using ... Read More

How to work with border layout position options in Java?

Nishtha Thakur

Nishtha Thakur

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

223 Views

Let us see some examples to work with different border layout position options such as PAGE_START, PAGE_END, etc.The following is an example of BorderLayout.PAGE_START option −Examplepackage my; import java.awt.BorderLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.JToolBar; public class SwingDemo {    public static void main(String[] args) { ... Read More

How to remove duplicates from a sorted linked list in android?

Nishtha Thakur

Nishtha Thakur

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

218 Views

This example demonstrate about How to remove duplicates from a sorted linked list in android.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

Advertisements