KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jena > dbremove


1 /*
2  * (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3  * [See end of file]
4  */

5
6 package jena;
7
8 //import com.hp.hpl.jena.rdf.model.* ;
9
//import com.hp.hpl.jena.db.* ;
10

11  /** Destroy a Jena RDF model available in a database. Use with care.
12   * <p>
13   * Usage:<pre>
14   * jena.dbremove [db spec]
15   * where [db spec] is:
16   * --spec file Contains an RDF description of the model
17   * --db JDBC_url --dbUser userId --dbPassword password --dbType [--model modelName]
18   * </pre>
19   * </p>
20   *
21   * @author Andy Seaborne
22   * @version $Id: dbremove.java,v 1.5 2005/02/21 11:49:12 andy_seaborne Exp $
23   */

24  
25 public class dbremove extends DBcmd
26 {
27     public static final String JavaDoc[] usage = new String JavaDoc[]
28     {
29         "dbremove [--spec spec] | [db_description] [--model name]" ,
30         " where db_description is" ,
31         " --db JDBC URL --dbType type" ,
32         " --dbUser user --dbPassword password"
33      } ;
34
35     public static void main(String JavaDoc[] args)
36     {
37         dbremove db = new dbremove();
38         db.setUsage(usage) ;
39         db.init(args);
40         db.exec();
41     }
42
43     public dbremove()
44     {
45         super("dbremove", false);
46     }
47
48     protected void exec0()
49     {
50         getRDBModel().remove() ;
51     }
52     
53     protected boolean exec1(String JavaDoc arg) { return false ; }
54 }
55  
56
57
58 /*
59  * (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
60  * All rights reserved.
61  *
62  * Redistribution and use in source and binary forms, with or without
63  * modification, are permitted provided that the following conditions
64  * are met:
65  * 1. Redistributions of source code must retain the above copyright
66  * notice, this list of conditions and the following disclaimer.
67  * 2. Redistributions in binary form must reproduce the above copyright
68  * notice, this list of conditions and the following disclaimer in the
69  * documentation and/or other materials provided with the distribution.
70  * 3. The name of the author may not be used to endorse or promote products
71  * derived from this software without specific prior written permission.
72  *
73  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
74  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
75  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
76  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
77  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
78  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
79  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
80  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
81  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
82  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
83  */

84
Popular Tags