devxlogo

Writing a Parameterized SQL Query in EJB 3.0

Writing a Parameterized SQL Query in EJB 3.0

protected EntityManager manager;...String ejbqlDelete = "delete from ClientTicket p where " +    "p.closed = :paramClosed and " +    "p.department = :paramDepartment and " +    "p.ticketUserID = :paramTicketUserID and " +    "p.ticketName = :paramTicketName";int deletedEntities = manager.createQuery(ejbqlDelete).   setParameter("paramClosed", Boolean.TRUE).   setParameter( "paramDepartment", adminid).   setParameter( "paramTicketUserID", userID ).   setParameter( "paramTicketName", delTicket ).   executeUpdate();

See also  Professionalism Starts in Your Inbox: Keys to Presenting Your Best Self in Email
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist