Thanks Dian, but the point of line-by-line profiling is to see which function calls take a long time. An alternative to line-by-line would be to collect profiling data on method calls, but it would be less useful to know that a lot of time is spent in the foo() method than to know that a...
Hi
How can I profile a J2EE application? Specifically, I want to be able to see which lines of code in my servlets take the most time to execute.
I have seen people suggest adding logging code to do this, but this is messy (adding code that doesn't need to be there) and time-consuming (if I...
Thanks sedj,
Do you have any recommendations as to which connection pooling library I should choose? My requirements are that I should have to make minimal changes to my code (I don't need the very best performance, I just need to reuse connections).
Thanks
Hi all
If I am using J2SE 1.4.2, a mysql DB (connecting using com.mysql.jdbc.Driver) and if I get a DB connection using DriverManager.getConnection(), are my DB connections pooled? (I.e. if I call close() on a connection object, is the connection actually closed, or just returned to a pool of...
This thread seems to be about what is called 'premature optimisation'.
Who cares if one method is faster than the other? You should write your code to be correct. If you later find that it does not meet your specification for speed, then you should profile your program to find out where it's...
The functionality you require is probably best implemented as a combination of a servlet (for the business logic) and one or more JSPs (for the presentation).
You will need to write code that will format the data returned in a ResultSet in a table, adding in the 'edit' and 'view' links. The...
The HttpServlet has an init() method which is called by the servlet container when the servlet is placed into service (this is inherited from GenericServlet). You can override this method in your servlet class to achieve your aims.
Note that there is a matching destroy() method which is called...
Thanks, but using HttpServletRequest.getServerPort() would only tell me the port number that the request was using. It would not tell me about all of the ports that are configured, which is what I want.
I would lift the following line out of the while loop:
s2 = conn.prepareStatement("select product_image_path from product_images where product_id = ?");
The PreparedStatement class is, in part, designed to allow you to efficiently run similar queries multiple times. So before entering the...
Note that integers can be negative, so the solution posted above, which basically just counts how many characters are required to render the integer as text will not work for negative integers (as the first character will be the '-' character indicating a negative number).
I suggest taking the...
Hi
I am writing a custom JSP tag and I need to be able to determine how the servlet container is configured. Specifically, I want to be able to do things like get a list of the port numbers in use and which schemes they are using (e.g. HTTPS on port 8443).
Is this possible?
I know I can...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.