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.
在这里,我们可以模拟数据库连接对象的查询方法,这样我们就只需要返回结果,而不需要真正地去查询数据库。
Listing 4 shows an excerpt from a method that establishes a DB2 database connection.
清单4显示了一个用于建立DB 2数据库连接的方法的摘录。
It is a very simple method for project management and has loose connection to software development.
它是项目管理的一种简单的方法,并且和软件开发有松弛连接关系。
It is in this method call that the database connection is obtained and subsequently closed.
就是在该方法调用中,我们获得然后再关闭数据库连接。
In a production implementation, you would use this method to create the internals of a database connection pool.
在一个生产实现中,可以使用该方法来创建数据库连接池的间隔。
Using this method, a connection is created each time you access the database from your program, thereby incurring a substantial processing overhead.
通过该方法,每当您从程序访问数据库时,都要创建连接,从而招致大量的处理开销。
The second method demonstrates accessing the database directly using a pooled database connection.
第二个方法演示了使用池态数据库连接直接访问数据库。
The connection manager can then call this method when the resource adapter indicates a connection error, or even periodically to remove broken connections from the pool.
然后连接管理器在资源适配器指示连接错误时调用这个方法,甚至定期调用该方法,以便从池中排除坏掉的连接。
Rather than reassociating the connection handle with the managed connection the next time a method is called, the optimization uses lazy association.
这种优化使用惰性关联,而不是在下次调用方法时重新将连接句柄与托管连接关联。
An alternative to consider if your data is going to be exposed over HTTP is a SPARQL connection method over HTTP, which makes your data "Linked data" -ready and can be completely distributed.
如果数据将通过HTTP公开,那么另一种备选方法是基于HTTP的SPARQL连接,这种方法使您的数据成为“链接数据”并且可以实现完全分布。
The maximum time the method will wait for a connection in this situation is specified by the connection pool's connection timeout property.
对于这种情况,该方法等待连接的最大等待时间是由连接池的连接超时属性指定的。
This method works fine as long as the connection to the server is not lost, in which case your connection to the server is rarely re-established.
只要与服务器的连接不断开这种方法就能良好运行,这种情况下很少需要重新建立到服务器的连接。
As with all JDBC resources, invoke the connections close method when you are done with the connection.
和所有JDBC资源一样,在使用完连接时,要调用连接关闭方法。
The dashed arrows in Figure 3 indicate the notification of the connection manager by the EJB container when a method completes.
图3中虚线箭头表示方法完成时ejb容器对连接管理器的通知。
The API is straightforward: You call a singleton method and get back a connection object.
API很直观:您调用单个方法,并返回一个连接对象。
The next step is to define the method that is called when the connection responds.
下一步是定义连接响应时要调用的方法。
The method of connection is indicated (GET), as well as the URL to connect to.
其中指定了连接方法(GET)和要连接的URL。
Let's start with the Connection object we pass into the method.
让我们以被传递到方法之中的Connection对象为出发点。
This is the only configurable LTC setting for Web components (servlets), and applies to bean managed transactions using the LocalTransaction.begin method on a Connection.
该属性是We b组件(servlet)唯一能配置的ltc设定值,通过在连接上使用LocalTransaction. begin方法应用于bean管理事务。
Provide the queue manager name and select the appropriate connection method, as shown in Figure 4
提供队列管理器名称并选择适当的连接方法,如图 4 所示。
However, instead of specifying a callback method, specify a delegate for the connection, once you have set this to self.
但是,一旦您将代理设置为self,就应该为连接指定一个代理,而不是一个回调方法。
To react to messages sent to you, use the add_message_callback method of your client connection.
要对发送给您的消息作出反应,请使用您的客户端连接的add_message_callback方法。
The session bean method then opens a connection with a messaging provider to send and receive messages.
然后由该会话bean方法打开与一个消息传递提供者的连接,以便发送和接收消息。
This matches any call to a method defined on a JDBC connection that returns a Statement or any subclass thereof.
这个建议匹配的方法调用是在JDBC连接上定义的,而且会返回Statement或任何子类。
Next, you obtain a handle to your LDAP connection established earlier in the Activator class’s initializeLDAP method.
接下来,将获得前面使用 Activator类的initializeLDAP方法建立的LDAP连接的一个句柄。
Things to note about this method are the use of the default connection and setting the autocommit mode to false.
对于这个方法,需要注意默认连接的使用,还要将自动提交模式设为false。
Once an authenticated connection is open, the getFeed() method retrieves the contacts feed.
一旦打开了一个已验证连接,getFeed()方法就会检索联系人提要。
The connect method accepts a timeout parameter, and if the connection does not succeed within the stipulated time period, it gives up.
connect方法接受一个超时参数,如果在指定的时间段内未能成功地连接,它就会放弃。
The simpleQuery() method in Listing 8 declares several variables and then establishes a database connection using a helper method defined in Listing 2.
清单 7 中的 simpleQuery()方法声明几个变量,然后使用清单2中定义的helper 方法建立一个数据库连接。
This is the only configurable LTC setting for Web components (servlets), and applies to bean managed transactions using the LocalTransaction.begin method on a connection.
该属性是We b组件(Servlet)唯一可配置的LTC设置,通过在连接上使用LocalTransaction. begin方法应用于Bean管理的事务。
应用推荐