KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > metadata > GetSchemas


1 package metadata;
2
3 import dinamica.*;
4 import java.sql.*;
5
6 /**
7  * Base class to program business transaction services (read/write).
8  * All transactions will subclass this class.
9  *
10  * <br>
11  * Creation date: 29/10/2003<br>
12  * Last Update: 29/10/2003<br>
13  * (c) 2003 Martin Cordova<br>
14  * This code is released under the LGPL license<br>
15  * @author Martin Cordova
16  * */

17 public class GetSchemas extends GenericTransaction
18 {
19
20     /* (non-Javadoc)
21      * @see dinamica.GenericTransaction#service(dinamica.Recordset)
22      */

23     public int service(Recordset arg0) throws Throwable JavaDoc
24     {
25         
26         int rc = 0;
27         
28         DatabaseMetaData md = getConnection().getMetaData();
29         ResultSet schemas = md.getSchemas();
30         Recordset rs = new Recordset(schemas);
31         schemas.close();
32         publish("schemas", rs);
33         return rc;
34
35     }
36
37 }
38
Popular Tags