SQL/MX Programming Manual for Java
SQL/MX Programming Considerations
HP NonStop SQL/MX Programming Manual for Java—523726-003
4-19
Precedence of Object Name Qualification
Connection Context of the SET Statements
The SET statements affect only dynamic SQL statements that share the same JDBC
connection. The JDBC/MX driver creates a different SQL context for each JDBC
connection. Therefore, each instance of a connection context class will have only those
dynamic SQL statements associated with it. Connection contexts that share a JDBC
connection share the same SET statements.
Example
In this example, the SET NAMETYPE statement affects only the dynamic UPDATE and
SELECT statements because they share the same JDBC connection, even though
they have different connection contexts:
ctx1 = SQLMXCtx.getDefaultContext();
#sql [ctx1] {SET NAMETYPE NSK};
#sql [ctx1] { /* Dynamic UPDATE statement */ };
#sql { /* Dynamic INSERT statement */ };
ctx2 = new SQLMXCtx(ctx1);
#sql [ctx2] { /* Dynamic SELECT statement */ };
ctx2.close();
#sql { /* Dynamic DELETE statement */ };
Precedence of Object Name Qualification
The DECLARE and SET statements take precedence over other methods of qualifying
unqualified database object names in an SQLJ program. For more information, see
Precedence of Object Name Qualification on page 4-22.