Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » SQL Anywhere Server - Programming » Java in the database » Java support in SQL Anywhere » The runtime environment for Java in the database


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:

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" );