AmitDiwan has Published 10744 Articles

How to use comparison operator for numeric string in MySQL?

AmitDiwan

AmitDiwan

Updated on 25-Feb-2020 12:23:34

114 Views

To use comparison operator for numeric string, use the substring() method. Let us first create a table −mysql> create table DemoTable1881    (    UserId int,    UserEducationGap varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1881 ... Read More

CharMatcher Class in Java

AmitDiwan

AmitDiwan

Updated on 20-Feb-2020 09:25:44

250 Views

The CharMatcher class determines a true or false value for any Java char value, just as Predicate does for any Object.Sr.NoMethods & Description1CharMatcher and(CharMatcher other)Returns a matcher that matches any character matched by both this matcher and other.2static CharMatcher anyOf(CharSequence sequence)Returns a char matcher that matches any character present in ... Read More

Insert record in a MySQL table with Java

AmitDiwan

AmitDiwan

Updated on 17-Feb-2020 06:56:12

821 Views

Let us first create a table. Following is the query to create a table in MySQL −mysql> create table DemoTable(    Id int,    Name varchar(30),    CountryName varchar(30),    Age int ); Query OK, 0 rows affected (0.66 sec)Following is the Java code to access MySQL database −import java.sql.Connection; ... Read More

Update a MySQL table with Java MySQL

AmitDiwan

AmitDiwan

Updated on 14-Feb-2020 10:24:53

4K+ Views

For this, you need to use PreparedStatement in Java for update. Let us first create a table −mysql> create table DemoTable(    Id int,    FirstName varchar(40) ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 'Chris'); Query ... Read More

How to insert DATE into a MySQL column value using Java?

AmitDiwan

AmitDiwan

Updated on 14-Feb-2020 10:23:16

3K+ Views

For this, you can use PreparedStatement from Java. Let us first create a table wherein one of the columns is ArrivalDate with DATE type −mysql> create table DemoTable(    PassengerId int,    PassengerName varchar(40),    ArrivalDate date ); Query OK, 0 rows affected (0.82 sec)The JAVA code is as follows ... Read More

Insert NULL value into database field with char(2) as type in MySQL?

AmitDiwan

AmitDiwan

Updated on 21-Jan-2020 12:21:27

329 Views

Let us first create a table −mysql> create table DemoTable658(FirstName varchar(100), value char(2)); Query OK, 0 rows affected (0.95 sec)Insert some records in the table using insert command −mysql> insert into DemoTable658(FirstName) values('John') ; Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable658(value, FirstName) values(default(value), 'Sam'); Query OK, ... Read More

Query non-empty values of a row first in ascending order and then display NULL values

AmitDiwan

AmitDiwan

Updated on 21-Jan-2020 12:19:53

173 Views

For this, use ORDER BY ISNULL(). Let us first create a table −mysql> create table DemoTable669 (    StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentScore int ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert command −mysql> insert into DemoTable669(StudentScore) values(45) ; ... Read More

Setting the element's text color using CSS

AmitDiwan

AmitDiwan

Updated on 09-Jan-2020 11:15:19

214 Views

The CSS color property is used to change the text color of an element. We can specify values as standard color name, rgb(), rgba(), hsl(), hsla() and hexadecimal value.SyntaxThe syntax for CSS color property is as follows −Selector {    color: /*value*/ }The following examples illustrate CSS color property −Example Live ... Read More

Setting Font Size with Keywords Using CSS

AmitDiwan

AmitDiwan

Updated on 09-Jan-2020 11:03:01

288 Views

The CSS font-size property can be set with absolute and relative keywords. This scales the text as desired.SyntaxThe syntax of CSS font-size property is as follows −Selector {    font-size: /*value*/ }The following table lists the standard keywords used in CSS −Sr.NoValue & Description1mediumSets the font-size to a medium size. ... Read More

Text Transformation Working with CSS

AmitDiwan

AmitDiwan

Updated on 09-Jan-2020 10:00:26

194 Views

The CSS text-transform property allows us to set text capitalization for an element. It can accept the following values: capitalize, lowercase, uppercase, full-width, full-size-kana and none.SyntaxThe syntax of CSS text-transform property is as follows −Selector {    text-transform: /*value*/ }ExampleThe following examples illustrate CSS text-transform property − Live Demo ... Read More

Advertisements