
Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.
Consider a table with data as below. + — — — + — — — — — — + — — — — — — +| ID | FIRSTNAME |
The first approach consists of annotating the class as below: @ToString@EqualsAndHashCode@Getter@Setter@RequiredArgsConstructorpublic class Foo { …} A shortcut for @ToString, @EqualsAndHashCode, @Getter on all fields, @Setter on all non-final fields, and
The SQL Server query optimizer processes a JOIN?in the same order as the tables appear in the FROM?clause, when FORCEPLAN?is ON. SET FORCEPLAN ON | OFF
CHECKSUM is a concept that is used to verify if the related files/contents are not tampered with or corrupted. On similar lines, MySQL provides CHECKSUM TABLE to verify the CHECKSUM
BitConverter’s ToString?method can be used to convert a byte array to a string. See below for an example: byte[] byteArray = ?string convertedString = BitConverter.ToString(byteArray).Replace(“-“,””);
Java uses the symbol tilde (~) to represent the operator. The following examples are clearly illustrative of the use and outcome of this operator. Code sample: public class JavaUnary{public static
See how to validate the length of a field in Java via javax.validation.constraints.Size. We can do it as follows: @NotNull@Size(min=3, message=”Name must be at least 3 characters long”)private String name;
Setting ARITHIGNORE?helps to control whether error messages will be returned from overflow or divide-by-zero errors occurring during a query. SET ARITHIGNORE ON | OFF
FileTime is a class in Java that helps you retrieve time-related information regarding files. One such method that we will see below is to get the modified time of a
To change the date format in C#, just use the ToUniverstalTime and the overload formatting as below: String isoFormat = inputDateTime.ToUniversalTime().ToString(“s”) + “Z”;
There are instances in which a user is created according to current requirements. However, as the design progress and requirements freezes or changes, there is a possible need to change
Literals of type long are expressed by adding an L suffix. For example: 0L // The decimal number zero (type ‘long’)1L // The decimal number one (type ‘long’)2147483648L // The value
There are a number of math functions in T-SQL. Here are a few of them: SELECT SQRT(49) –Gives 7, Square RootSELECT PI() –Gives 3.14 …. PISELECT ROUND(15.30, 0) –Gives 15.
In MySQL, a user is allowed to have a PROXY user. This means that a user can behave the same way as the original user with the same permissions as

We can use the GetDistinaceTo?method of the GetCoordinates?class to determine the distance between two coordinates in C#. See below for an example: Using System.Device.Location;//double distance = 0.0;var aCoordinate = new
Logs often come in handy for problem resolution. However, there are times when there are too many logs that are not useful from the developer’s perspective. One such log is
Setting the Hibernate batching size can be accomplished via hibernate.jdbc.batch_size. In Spring, we need to add in application properties per the following setting (the recommended batch size is between 5
LOCK_TIMEOUT?specifies the number of milliseconds a statement should wait for a lock to be released, for example: SET LOCK_TIMEOUT 1000 –Wait one second
Elements that are added after initial page load through an DOM action do not have event handlers attached to them. We can use the live event handler to attach the
Every table in MySQL will have a storage engine that offers certain capabilities. Some storage engines offer performance, some of them transaction support, and so on. By default, all tables
Via Java Reflection API, we can obtain all the annotations of a class as follows: Class clazz = Foo.class;Annotation[] clazzAnnotations = clazz.getAnnotations();
NUMERIC_ROUNDABORT?specifies the level of error reporting that has been generated when an expression being rounded has caused loss of precision. SET NUMERIC_ROUNDABORT ON
See below for a code sample of how to perform byte and string conversions: using System.Runtime.Remoting.Metadata.W3cXsd2001;public static byte[] GetStringToBytes(string stringValue){ SoapHexBinary result = SoapHexBinary.Parse(stringValue); return result.Value;}public static string GetBytesToString(byte[] byteArray){
In order to check whether or not an index is in range [0, n) we can rely on a “if” statement, as below: if (index = n) { … }
MySQL allows various permissions to be set for users during (or after) creation. The following command comes handy to understand what GRANTS a user has. Command: SHOW GRANTS FOR user;

Beginning with JDK 8, the machine UTC timestamp with nanoseconds precision can be obtained via the java.time.Instant class as below: // e.g., 2019-02-26T15:28:21.051163100ZInstant now = Instant.now();
Reseed all Autonumber fields in all tables with the following query: EXEC sp_MSForEachTable ‘ IF OBJECTPROPERTY(object_id(”?”), ”TableHasIdentity”) = 1 DBCC CHECKIDENT (”?”, RESEED, 0)
Starting with JDK 9, we can create an immutable list via the suite of List#of(…) methods. For example, an immutable list of 3 elements can be created as follows: import java.util.List;…List

There are several approaches for repeating a string n times. In functional-style, we can rely on Stream.generate(), as in the following example: String result = Stream.generate(() – TEXT) .limit(5) .collect((joining()));
This command is similar to that of an operating system command that shows all the processes. In MySQL, this command, when executed, lists all of the processes that hold a










