Subversion Repositories DevTools

Rev

Rev 7299 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7299 Rev 7323
Line 29... Line 29...
29
//              another program, and not a human.
29
//              another program, and not a human.
30
//              Each line constits of a a tag and a data field. The tag describes
30
//              Each line constits of a a tag and a data field. The tag describes
31
//              the data that follows and the progress of the operation.
31
//              the data that follows and the progress of the operation.
32
//
32
//
33
//              Output lines:
33
//              Output lines:
34
//                      Status:xxxxx                    - Indicates program status
34
//                      Status:xxxxx                        - Indicates program status
35
//                      Error:xxxxx                     - Error messages
35
//                      Error:xxxxx                         - Error messages
36
//                      Info:ColumnCount                - SQL info: number of Cols of data
36
//                      Info:ColumnCount:x                  - SQL info: number of Cols of data
-
 
37
//                      Info:ColumnInfo:x:name:width:type   - SQL info: Names of all of the columns and other data
37
//                      DataStart:                      - Start of SQL response
38
//                      DataStart:                          - Start of SQL response
38
//                      Data:xxxx,yyyy,zzzz,...         - SQL response
39
//                      Data:xxxx,yyyy,zzzz,...             - SQL response
39
//                      DataEnd:                        - End of SQL response
40
//                      DataEnd:                            - End of SQL response
40
//
41
//
41
//              The Data: lines contain coma-seperated fields. The fields are
42
//              The Data: lines contain coma-seperated fields. The fields are
42
//                        encoded as 4 bits per byte added to an ascii-0. A cheap
43
//                        encoded as 4 bits per byte added to an ascii-0. A cheap
43
//                        hex encoding.
44
//                        hex encoding.
44
//
45
//
Line 241... Line 242...
241
              //
242
              //
242
              ResultSetMetaData rsmd = rset.getMetaData();
243
              ResultSetMetaData rsmd = rset.getMetaData();
243
              int numberOfColumns = rsmd.getColumnCount();
244
              int numberOfColumns = rsmd.getColumnCount();
244
              System.out.println( "Info:ColumnCount:" + numberOfColumns );
245
              System.out.println( "Info:ColumnCount:" + numberOfColumns );
245
 
246
 
-
 
247
              // The column count starts from 1
-
 
248
              for (int i = 1; i <= numberOfColumns; i++ ) {
-
 
249
                  System.out.println( "Info:ColumnInfo:" + i 
-
 
250
                                      + ":" + rsmd.getColumnName(i) 
-
 
251
                                      + ":" + rsmd.getColumnDisplaySize(i) 
-
 
252
                                      + ":" + rsmd.getColumnTypeName(i) );
-
 
253
              }
-
 
254
 
246
              //
255
              //
247
              //    Return all rows to the user
256
              //    Return all rows to the user
248
              //
257
              //
249
              System.out.println( "DataStart:");
258
              System.out.println( "DataStart:");
250
              while (rset.next ())
259
              while (rset.next ())