|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
dods.servlet.DODSServlet
dods.servers.sql.dodsSQLServlet
This extension of DODSServlet adds JDBC connection functionality to the
servlet design.
Because of the unusual nature of DBMS systems with respect to other types
of data archives, the usual procedures for retrieving data in a DODS server
needed to be changed. This class, dodsSQLServlet
, encapsulates
the logic for interacting with a DBMS. This includes getting the client's
DODS request, changing it to an SQL query, querying the DBMS (using JDBC)
and then collecting the reply and sending the returned data to the client.
The information for making the JDBC connection should be located in the
iniFile
object that is inflated by the doGet()
method of the parent class DODSServlet
. The section in the
iniFile should look like:
[JDBC] Driver = the.name.of.the.jdbc.driver ConnectionURL = jdbc:somevendor://targetmachine:port username = guest password = MaxResponseLength = 300
doGet()
,
Serialized FormConstructor Summary | |
dodsSQLServlet()
|
Method Summary | |
void |
doGetDODS(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ReqState rs)
Handler for the client's data request. |
protected GuardedDataset |
getDataset(ReqState rs)
Supress this method (just pass through it) we need a special DDS here, and thus this method gets replaced by getSQLDDS(). |
abstract java.lang.String |
getServerVersion()
This function must be implemented locally for each DODS server. |
protected abstract GuardedSQLDataset |
getSQLDataset(ReqState rs)
This function must be implemented locally for each DODS server. |
void |
init()
Intitializes the servlet. |
void |
printColumnNames(java.sql.ResultSetMetaData m,
java.io.PrintStream dOut)
Read the meta data stream and print up column names with type information |
void |
processResult(java.sql.ResultSet result,
java.io.PrintStream dOut)
|
Methods inherited from class dods.servlet.DODSServlet |
anyExceptionHandler, badURL, dodsExceptionHandler, doGet, doGetASC, doGetCatalog, doGetDAS, doGetDDS, doGetDIR, doGetHELP, doGetHTML, doGetINFO, doGetStatus, doGetVER, getDAS, getServerName, isTheClientCompressed, openCachedDAS, openCachedDDS, parseExceptionHandler, printCatalog, printStatus, probeRequest, processDodsURL, sendDODSError |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public dodsSQLServlet()
Method Detail |
protected abstract GuardedSQLDataset getSQLDataset(ReqState rs) throws DODSException, java.io.IOException, ParseException
rs
- The ReqState object containing the particulars of this client request..
DODSException
java.io.IOException
ParseException
ServerDDS
,
sqlServerFactory
,
test_ServerFactory
protected GuardedDataset getDataset(ReqState rs) throws DODSException, java.io.IOException, ParseException
getDataset
in class DODSServlet
rs
- The ReqState object containing the particulars of this client request..
DODSException
java.io.IOException
ParseException
ServerDDS
,
sqlServerFactory
,
test_ServerFactory
public abstract java.lang.String getServerVersion()
getServerVersion
in class DODSServlet
public void init() throws javax.servlet.ServletException
init
in class DODSServlet
javax.servlet.ServletException
public void doGetDODS(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ReqState rs) throws java.io.IOException, javax.servlet.ServletException
Once the DDS has been parsed, the projection is determine by proccesing the constraint expression. The SQLDDS is then asked to convert it's projection and selection information into an SQL query. This query is then submitted to the DBMS. The result set is then read into the SQLDDS. In the the process, the data is returned to the client. Neat, eh?
doGetDODS
in class DODSServlet
request
- The client's HttpServletRequest
request
object.response
- The server's HttpServletResponse
response
object.rs
- The ReqState object containing the particulars of this client request..
This is used (if it's not just empty) subset the data in the dataset.
java.io.IOException
javax.servlet.ServletException
public void processResult(java.sql.ResultSet result, java.io.PrintStream dOut) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public void printColumnNames(java.sql.ResultSetMetaData m, java.io.PrintStream dOut) throws java.sql.SQLException
java.sql.SQLException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |