spo.src.JDBC
Class XConnection

java.lang.Object
  |
  +--spo.src.JDBC.XConnection

public class XConnection
extends java.lang.Object

Class XConnection is java class, which allows client to connect to the SPDBMS data server.

Version:
1.0
Author:
Wenzhong Zhao

Field Summary
(package private) static java.lang.String DEFAULT_HOST
           
(package private) static int DEFAULT_PORT
           
 
Constructor Summary
XConnection()
          Default constructor Initialize the XConnection
 
Method Summary
 void close()
          Close the connection to the data server
 void connect()
          Use default host and port to connect
 void connect(java.lang.String host, int port)
          Connect to the data server with (host, port)
 java.lang.String create(java.lang.String relName, java.lang.String schemaURL)
          Create the relation in the data server
 java.lang.String delete(java.lang.String relName, java.lang.String condition)
          Delete from the relation SPOs which satisfy the condition
 java.lang.String drop(java.lang.String relName)
          Drop the relation
 java.lang.String getRelNames()
          Get the names of relations in the data server
 java.lang.String insert(java.lang.String relName, java.lang.String xmlFile)
          Insert a xml file into the relation
 java.lang.String query(java.lang.String queryStr, boolean isXML)
          Send a query to the data server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HOST

static final java.lang.String DEFAULT_HOST
See Also:
Constant Field Values

DEFAULT_PORT

static final int DEFAULT_PORT
See Also:
Constant Field Values
Constructor Detail

XConnection

public XConnection()
Default constructor Initialize the XConnection

Method Detail

connect

public void connect()
Use default host and port to connect


connect

public void connect(java.lang.String host,
                    int port)
Connect to the data server with (host, port)

Parameters:
host - data server name
port - the prot number which the server is listening

close

public void close()
Close the connection to the data server


getRelNames

public java.lang.String getRelNames()
                             throws java.io.IOException
Get the names of relations in the data server

java.io.IOException

create

public java.lang.String create(java.lang.String relName,
                               java.lang.String schemaURL)
                        throws java.io.IOException
Create the relation in the data server

Parameters:
relName - name of the relation
schemaURL - URL string of the schema
java.io.IOException

drop

public java.lang.String drop(java.lang.String relName)
                      throws java.io.IOException
Drop the relation

Parameters:
relName - name of the relation
java.io.IOException

insert

public java.lang.String insert(java.lang.String relName,
                               java.lang.String xmlFile)
                        throws java.io.IOException
Insert a xml file into the relation

Parameters:
relName - name of the relation
xmlFile - name the xml file
java.io.IOException

delete

public java.lang.String delete(java.lang.String relName,
                               java.lang.String condition)
                        throws java.io.IOException
Delete from the relation SPOs which satisfy the condition

Parameters:
relName - name of the relation
condition - the condition string
java.io.IOException

query

public java.lang.String query(java.lang.String queryStr,
                              boolean isXML)
                       throws java.io.IOException
Send a query to the data server

Parameters:
queryStr - the query string
isXML - set the format of the query result. true will return XML, otherwise HTML
java.io.IOException


Copyright © 2003 UKCS. All Rights Reserved.