Query string for findByPimaryKey() with primary key argument

Discussions

EJB programming & troubleshooting: Query string for findByPimaryKey() with primary key argument

  1. Hi All,

    I am new to J2EE.
    I am using J2EE reference implementation 1.2.1 and trying to deploy CMP entity bean with MS Access in the backend.
    I am facing few problems with my J2EE server while deploying beans.

    1) There has been a constant problem on my machine since long time that my J2EE deploytool does not generate
        queries for the finder methods and other mthods. It gives a message to check whether database server is on or to check the username password where as there is no username and password to my MS Access database.

    2) I am trying to deploy a CMP enitity bean called Product with a primary key class by manually writing the queries.
       In case CMP entity bean with primary key in a seperate class the findByPimaryKey() method in the home interface takes
       primary key object as an argument.
       Now since I am writing queries mannually I want to know how should I write the query string for findByPimaryKey(ProductPK pk)
       and since J2EE 1.2.1 implements EJB 1.1 I can't use EJB QL like with EJB 2.0 .

       Please help me and answer my second question amd if possible 1st question also.
      
       Thanks in advance
        Rupesh
  2. If you want to write your own queries, you should use BMP and implement findByPrimaryKey() with your query.

    Pranab
  3. There _is_ a user name and password for your database. MS Access when it opens a DB tries to log you in as user "Admin" with no password. Only if that fails does it ask you to login.

    So, set the user name as Admin and the password as an empty string and then try it. See if that helps.

    Chz

    TOny