📄 jagg.htm
字号:
<!--NewPage--><html><head><!-- Generated by javadoc on Fri Mar 15 20:30:33 1996 --><a name="_top_"></a><title> Class Jagg</title></head><body><h1> Class Jagg</h1><pre><a href="java.lang.Object.html#_top_">java.lang.Object</a> | +----Jagg</pre><hr><dl> <dt> class <b>Jagg</b> <dt> extends <a href="java.lang.Object.html#_top_">Object</a></dl>Class Jagg represents an SQL query to the Jagg Server.Most parameters are optional or have reasonable defaults. All parameters have a get...() and set...() method.<P>Each separate query is executed with a single method, execSQL().Results are entered into a Vector, one Vector element per row.Each row is returned and stored as a String. The fields areseparated by the configurable separator character (default TAB).<P>The return value from the query method indicates an error (negative) or success(0 or positive) indicating the number of rows affected.<P>Detailed error information is available through the getError() method.<P>Jagg-at-a-Glance example:<PRE>// Setup a Jagg instance, supplying the server location.Jagg q = new Jagg("http://dbserve.mycorp.com/cgi-bin/jagg.exe");q.setDSN("Test Data 1"); // Set the Data Source Name for the first queries.q.setMRW("20"); // Set the Maximum RoWs to return.int recNum;Vector queryResult;recNum = execSQL("select quantity,reorder from stock where item = \'widgets\'", queryResult);if( recNum == -1 ) { System.out.println(q.getError()); // Other corrective action...}</PRE><hr><a name="index"></a><h2> <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index"></h2><dl> <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o "> <a href="#Jagg(java.lang.String)"><b>Jagg</b></a>(String) <dd> Creates a query object for the server specified.</dl><h2> <img src="images/method-index.gif" width=207 height=38 alt="Method Index"></h2><dl> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#execSQL(java.lang.String, java.util.Vector)"><b>execSQL</b></a>(String, Vector) <dd> Execute an SQL query and fills the supplied Vector with the results. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getColumnCount()"><b>getColumnCount</b></a>() <dd> Get the column count for the last query. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getDB()"><b>getDB</b></a>() <dd> Get the database name. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getDLOG()"><b>getDLOG</b></a>() <dd> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getDSN()"><b>getDSN</b></a>() <dd> Get the current DSN (Data Source Name). <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getError()"><b>getError</b></a>() <dd> Get the details of the last error. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getLSQL()"><b>getLSQL</b></a>() <dd> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getMRW()"><b>getMRW</b></a>() <dd> Get maximum number of rows. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getPWD()"><b>getPWD</b></a>() <dd> Get the user password. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getRowCount()"><b>getRowCount</b></a>() <dd> Get the row count for the last query. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getSEP()"><b>getSEP</b></a>() <dd> Get separator character. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getServer()"><b>getServer</b></a>() <dd> Get the path to the Jagg server. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getTOUT()"><b>getTOUT</b></a>() <dd> Get the SQL timeout. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getUID()"><b>getUID</b></a>() <dd> Get the user id. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getVersion()"><b>getVersion</b></a>() <dd> Get the JAGG class version. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getWSID()"><b>getWSID</b></a>() <dd> Get the workstation id. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setDB(java.lang.String)"><b>setDB</b></a>(String) <dd> Set the database name for the query. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setDLOG(java.lang.String)"><b>setDLOG</b></a>(String) <dd> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setDSN(java.lang.String)"><b>setDSN</b></a>(String) <dd> Set DSN (Data Source Name). <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setLSQL(java.lang.String)"><b>setLSQL</b></a>(String) <dd> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setMRW(java.lang.String)"><b>setMRW</b></a>(String) <dd> Set the maximum number of rows to return. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setPWD(java.lang.String)"><b>setPWD</b></a>(String) <dd> Set the user password for the query. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setSEP(java.lang.String)"><b>setSEP</b></a>(String) <dd> Set optional separator character. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setTOUT(java.lang.String)"><b>setTOUT</b></a>(String) <dd> Set the SQL timeout. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setUID(java.lang.String)"><b>setUID</b></a>(String) <dd> Set the user id for the query. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setWSID(java.lang.String)"><b>setWSID</b></a>(String) <dd> Set the workstation id for the query.</dl><a name="constructors"></a><h2> <img src="images/constructors.gif" width=231 height=38 alt="Constructors"></h2><a name="Jagg"></a><a name="Jagg(java.lang.String)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a><b>Jagg</b><pre> public Jagg(<a href="java.lang.String.html#_top_">String</a> Serv)</pre><dl> <dd> Creates a query object for the server specified. <dl> <dt> <b>Parameters:</b> <dd> Server - The path to the Jagg server.<P>Example:<PRE>Jagg q = new Jagg("http://dbserv.mycorp.com/cgi-bin/jagg.exe");</PRE>You will need to set the various query parameters that are needed by your Data Sources.<P>Example:<PRE>q.setDSN("Test Data 1"); // Set the Data Source Name.q.setMRW("20"); // Set the Maximum RoWs to return.q.setUID("admin1"); // Set user and password.q.setPWD("2helpu");</PRE> </dl></dl><a name="methods"></a><h2> <img src="images/methods.gif" width=151 height=38 alt="Methods"></h2><a name="execSQL(java.lang.String, java.util.Vector)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="execSQL"><b>execSQL</b></a><pre> public int execSQL(<a href="java.lang.String.html#_top_">String</a> SQL, <a href="java.util.Vector.html#_top_">Vector</a> v)</pre><dl> <dd> Execute an SQL query and fills the supplied Vector with the results.Each result row returns as a String object containing the fields separatedby the configurable separator character. See setSEP().As a side effect of running execSQL, counts are set indicating the numberof rows of data returned from the query, and the number of columns. See getRowCount()and getColumnCount(). Note that the number of data rows returned may be differentfrom the return value of execSQL, which is the number returned by the query itselfas the number of rows affected by this query (for example an update might returna number of rows affected, but no data rows). <dl> <dt> <b>Parameters:</b> <dd> SQL - The SQL to execute. <dd> v - The Vector which will hold the results. <dt> <b>Returns:</b> <dd> An integer which indicates the number of rows affected by the query. A negative return value indicates an error. This error can be checked in more detail with getError(). In the case of an error, the Vector contains no rows. <dt> <b>See Also:</b> <dd> <a href="#getSEP">getSEP</a>, <a href="#getError">getError</a>, <a href="#getRowCount">getRowCount</a>, <a href="#getColumnCount">getColumnCount</a> </dl></dl><a name="getServer()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="getServer"><b>getServer</b></a><pre> public <a href="java.lang.String.html#_top_">String</a> getServer()</pre><dl> <dd> Get the path to the Jagg server. This is set in the Jagg class constructor.You should not need to change this path after it is set. <dl> <dt> <b>Returns:</b> <dd> String object containing the server path. </dl></dl><a name="setDSN(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setDSN"><b>setDSN</b></a><pre> public void setDSN(<a href="java.lang.String.html#_top_">String</a> DSN)</pre><dl> <dd> Set DSN (Data Source Name). <dl> <dt> <b>Parameters:</b> <dd> DSN - The new DSN. </dl></dl><a name="getDSN()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="getDSN"><b>getDSN</b></a><pre> public <a href="java.lang.String.html#_top_">String</a> getDSN()</pre><dl> <dd> Get the current DSN (Data Source Name). <dl> <dt> <b>Returns:</b> <dd> String containing the DSN. </dl></dl><a name="setSEP(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setSEP"><b>setSEP</b></a>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -