Once the context object goes out of scope, which like a database connection should be very quickly, the data objects essentially become read-only.
就像数据库连接那样应该非常快,一旦该上下文对象超出范围,数据对象实质上就进入只读状态。
When a database connection is established, DB2 compares the attributes of that connection against the definitions of each trusted context object in the database.
当建立一个数据库连接时,DB 2将那个连接的属性与数据库中每个可信上下文对象的定义相比较。
In this case, we would mock the query method of the database connection object so that we could just return back the results instead of calling out to the database for them.
在这里,我们可以模拟数据库连接对象的查询方法,这样我们就只需要返回结果,而不需要真正地去查询数据库。
应用推荐