Clover coverage report - Replica - 1.0-Alpha
Coverage timestamp: Dom Fev 1 2004 17:00:58 WET
file stats: LOC: 68   Methods: 4
NCLOC: 56   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
Utilities.java 0% 0% 0% 0%
coverage
 1   
 package nmp.dbms.util;
 2   
 
 3   
 import java.io.*;
 4   
 import nmp.dbms.*;
 5   
 
 6   
 public class Utilities
 7   
 {
 8   
     /**
 9   
      * Displays a result set with column separated by a tab
 10   
      */
 11  0
     public static void displayResultSet( PrintStream ps, SQLVectorResult result) {
 12  0
         PrintWriter pw = new PrintWriter( ps);
 13  0
         displayResultSet( pw, result);
 14  0
         pw.flush();
 15   
     }
 16   
 
 17  0
     public static void displayResultSet( PrintWriter pw, SQLVectorResult result) {
 18  0
         if( result == null || result.rows == null || result.columnName == null)
 19  0
             pw.println( "Internal error");
 20  0
         for( int i = 0; i < result.columnName.length; i++)
 21  0
             pw.print( result.columnName[i] + "\t");
 22  0
         pw.println();
 23  0
         for( int i = 0; i < result.rows.size(); i++) {
 24  0
             Object[] row = (Object[])result.rows.elementAt( i);
 25  0
             for( int j = 0; j < row.length; j++) {
 26  0
                 if( row[j] == null)
 27  0
                     pw.print( "null\t");
 28   
                 else
 29  0
                     pw.print( row[j].toString() + "\t");
 30   
             }
 31  0
             pw.println();
 32   
         }
 33   
     }
 34   
 
 35   
     /**
 36   
      * Displays a result in a HTML table
 37   
      */
 38  0
     public static void displayHTMLResultSet( PrintStream ps, SQLVectorResult result) {
 39  0
         PrintWriter pw = new PrintWriter( ps);
 40  0
         displayHTMLResultSet( pw, result);
 41  0
         pw.flush();
 42   
     }
 43   
 
 44  0
     public static void displayHTMLResultSet( PrintWriter pw, SQLVectorResult result) {
 45  0
         if( result == null || result.rows == null || result.columnName == null)
 46  0
             pw.println( "Internal error");
 47  0
         pw.println( "<table border=\"2\" cellspacing=\"3\" cellpadding=\"5\">");
 48  0
         pw.println( "<tr>");
 49  0
         for( int i = 0; i < result.columnName.length; i++)
 50  0
             pw.print( "<th>" + result.columnName[i] + "</th>");
 51  0
         pw.println( "</tr>");
 52  0
         for( int i = 0; i < result.rows.size(); i++) {
 53  0
             Object[] row = (Object[])result.rows.elementAt( i);
 54  0
             pw.println( "<tr>");
 55  0
             for( int j = 0; j < row.length; j++) {
 56  0
                 pw.print( "<td>");
 57  0
                 if( row[j] == null)
 58  0
                     pw.print( "NulL\t");
 59   
                 else
 60  0
                     pw.print( row[j].toString() + "\t");
 61  0
                 pw.println( "</td>");
 62   
             }
 63  0
             pw.println( "</tr>");
 64   
         }
 65  0
         pw.println( "</table>");
 66   
     }
 67   
 }
 68