Results 1 to 1 of 1
  1. #1
    Join Date
    Oct 2003
    Location
    Frisco, TX
    Posts
    21

    Unhappy Unanswered: Not getting all results from stored procedure.

    I have tried a couple different drivers now, so it must be something I am doing. When you execute "sp_spaceused" using SQL Query Analyser (using MS SQL Server 2000) you get back 2 (two) grids:

    column
    .........1...........................2............ ........3............................4
    1) database_name....database_size...unnalocated space
    2) reserved...................data............ index_size...............unused

    This is what the documentation tells me I should get.

    When I make the call using Java, I only get back the first grid!

    Here is what I am trying:

    Code:
    String sqlSpace   = "{call sp_spaceused}";
    
    CallableStatement stmtSpace   = connection.prepareCall(sqlSpace);
    
    ResultSet rSpace   = stmtSpace.executeQuery();
    
    while(rSpace.next())
    {
        ResultSetMetaData metaDataGeneral = rSpace.getMetaData();
    
         int nColCount = metaDataGeneral.getColumnCount();
    
         for(int n = 1; n <= nColCount; n++)
         {
             System.out.println(metaDataSpace.getColumnName(n));
             System.out.println(rSpace.getString(n));     
         }
    .
    .
    .
    What am I doing wrong, or need to do to get to the other data (which I would THINK would be in the next rowset...but it doesn't appear to be)?
    Last edited by darrinps; 10-10-03 at 15:43.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •