KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > odmg > AccessThread


1 // $Id: AccessThread.java,v 1.3 2003/11/23 15:19:37 per_nyfelt Exp $
2
package odmg;
3
4 import org.odmg.*;
5
6 class AccessThread extends Thread JavaDoc {
7
8     Database db;
9     Transaction tx;
10
11
12     public AccessThread( Database _db, Transaction _tx ) {
13         db = _db;
14         tx = _tx;
15     }
16
17
18     public void run() {
19         try {
20             tx.join();
21             Auto auto = (Auto)db.lookup( "name" );
22             System.out.println( Thread.currentThread().getName() + ": " + auto );
23         } catch (Exception JavaDoc e) {
24             e.printStackTrace();
25         }
26     }
27 }
28
Popular Tags