devxlogo

Tip Bank

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 ” +

Avoid Object Instantiation Within Loops

Avoid defining new objects within loop structures. Doing so hampers performance significantly, due to object creation overhead. Instead, define objects outside the loop and then use them inside the loop.

Measuring A Program’s Speed

The simplest way to measure the performance of a block of code (or an entire program) is to obtain the elapsed time. This tip shows you how. ‘At the top

Optimizing Loops in JavaScript

Not all JavaScript loops are identical. Try the code below by pasting the HTML in this tip into a file and then opening the file in your browser. You should