Strings in Java and SQL

A set of double quotes identifies string literals in Java, as in the following Java code fragment:

String str = "This is a string";

In SQL, however, single quotes mark strings, and double quotes indicate an identifier, as illustrated by the following SQL statement:

INSERT INTO TABLE DBA.t1
VALUES( 'Hello' );

You should always use the double quote in Java source code, and single quotes in SQL statements.

The following Java code fragment is valid, if used within a Java class.

String str = new java.lang.String(
            "Brand new object" );