Problems while using JDBC-ODBC Bridge with Java 2


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Problems while using JDBC-ODBC Bridge with Java 2

Hybrid View

  1. #1
    Syed Guest

    Problems while using JDBC-ODBC Bridge with Java 2


    I am using JDBC ODBC bridge to access the Microsoft Access databases. Sometimes
    when I query the tables(select * from xxx), I receive lesser number of records
    than the actual number of records in the table. It is not returning the actual
    number of rows in the table always. It always varies. Could anybody tell
    me what could be the reson?.

    Also when I give a query shown below, it is not returning any row but it
    returns a few rows when I run this query inside Microsoft Access. Thanks
    in advance to whoever rendering help for my problem...
    --------------
    SELECT *
    FROM Currencies INNER JOIN (UnitsOfMeasurement INNER JOIN ((((ProductList
    INNER JOIN ProductGroup ON [ProductList].[GroupID]=[ProductGroup].[GroupID])
    INNER JOIN ProductClassification ON [ProductGroup].[GroupID]=[ProductClassification].[GroupID])
    INNER JOIN ProductBrand ON ([ProductClassification].[GroupID]=[ProductBrand].[GroupID])
    AND ([ProductClassification].[ClassificationID]=[ProductBrand].[ClassificationID])
    AND ([ProductGroup].[GroupID]=[ProductBrand].[GroupID])) INNER JOIN ProductModel
    ON ([ProductBrand].[GroupID]=[ProductModel].[GroupID]) AND ([ProductBrand].[ClassificationID]=[ProductModel].[ClassificationID])
    AND ([ProductBrand].[BrandID]=[ProductModel].[BrandID]) AND ([ProductModel].[GroupID]=[ProductList].[GroupID])
    AND ([ProductModel].[ClassificationID]=[ProductList].[ClassificationID])
    AND ([ProductModel].[BrandID]=[ProductList].[BrandID]) AND ([ProductModel].[ModelID]=[ProductList].[ModelID])
    AND ([ProductGroup].[GroupID]=[ProductModel].[GroupID])) ON [UnitsOfMeasurement].[UnitID]=[ProductList].[UnitOfMeasurement])
    ON [Currencies].[CurrencyID]=[ProductList].[SellingCurrency]
    WHERE companyid=50
    ORDER BY [productlist].[groupid], [productgroup].[description];
    ---------------


    Thanks,
    Syed.

  2. #2
    Syed Zulfiqar Guest

    Re: Problems while using JDBC-ODBC Bridge with Java 2


    Hi Syed,
    It seems that u have not commited in your database(access). Try to
    commit whatever u have done in the database and close Access. Then run your
    program.
    Still if it doesn't work print the SQL String(thru ur java program)
    in the command prompt and try to cut-paste and run the code in ACCESS. It's
    a good practise!!!.

    Cheers
    Syed Zulfiqar

    "Syed" <mirkasim@yahoo.com> wrote:
    >
    >I am using JDBC ODBC bridge to access the Microsoft Access databases. Sometimes
    >when I query the tables(select * from xxx), I receive lesser number of records
    >than the actual number of records in the table. It is not returning the

    actual
    >number of rows in the table always. It always varies. Could anybody tell
    >me what could be the reson?.
    >
    >Also when I give a query shown below, it is not returning any row but it
    >returns a few rows when I run this query inside Microsoft Access. Thanks
    >in advance to whoever rendering help for my problem...
    >--------------
    >SELECT *
    >FROM Currencies INNER JOIN (UnitsOfMeasurement INNER JOIN ((((ProductList
    >INNER JOIN ProductGroup ON [ProductList].[GroupID]=[ProductGroup].[GroupID])
    >INNER JOIN ProductClassification ON [ProductGroup].[GroupID]=[ProductClassification].[GroupID])
    >INNER JOIN ProductBrand ON ([ProductClassification].[GroupID]=[ProductBrand].[GroupID])
    >AND ([ProductClassification].[ClassificationID]=[ProductBrand].[ClassificationID])
    >AND ([ProductGroup].[GroupID]=[ProductBrand].[GroupID])) INNER JOIN ProductModel
    >ON ([ProductBrand].[GroupID]=[ProductModel].[GroupID]) AND ([ProductBrand].[ClassificationID]=[ProductModel].[ClassificationID])
    >AND ([ProductBrand].[BrandID]=[ProductModel].[BrandID]) AND ([ProductModel].[GroupID]=[ProductList].[GroupID])
    >AND ([ProductModel].[ClassificationID]=[ProductList].[ClassificationID])
    >AND ([ProductModel].[BrandID]=[ProductList].[BrandID]) AND ([ProductModel].[ModelID]=[ProductList].[ModelID])
    >AND ([ProductGroup].[GroupID]=[ProductModel].[GroupID])) ON [UnitsOfMeasurement].[UnitID]=[ProductList].[UnitOfMeasurement])
    >ON [Currencies].[CurrencyID]=[ProductList].[SellingCurrency]
    >WHERE companyid=50
    >ORDER BY [productlist].[groupid], [productgroup].[description];
    >---------------
    >
    >
    >Thanks,
    >Syed.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center