Kanuri Phanibabu

Greenhorn
+ Follow
since May 19, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kanuri Phanibabu

Thankyou Herman Scheltinga, for your reply and suggesions.
If you have any tips that increase the performance of the application / know any url's please suggest me.

Hi Friends,

Please send me your openion regarding this issue.

Actually i am using a DAOImpl class where i will get the data base connection. The code snippet for one method is like this...
And i am repeating the same procedure in each method like opening the connection and closing the connection in each method.

My problem is:

Is it right to open and closing connection in each method of DAO implementaton class?
and how can i alter the code if there exist any performance issue?

This application is a web based appliation using struts.

In the Action class i am calling each required implementation method.

public EmployeeDAOImpl(DataSource dataSource) {
this.dataSource = dataSource;
}

/**
Checks if an employee is Admin for the specified module in RMS_MODULE_ADMINS table.
**/

public boolean isAdmin(String employeeId, String moduleId) {

logger
.debug("Entered - isAdmin() of EmployeeDAOIMPL with arguments EmployeeId:"
+ employeeId + "and ModuleId:" + moduleId + ".");

Connection conn_Admin = null;
PreparedStatement pst_Admin = null;
ResultSet rs_Admin = null;

boolean isAdmin = false;

try {
conn_Admin = dataSource.getConnection();
pst_Admin = conn_Admin
.prepareStatement("SELECT ROLE_ID FROM RMS_MODULE_ADMINS "
+ "WHERE EMP_ID = ? AND MODULE_ID = ?");
pst_Admin.setString(1, employeeId.toLowerCase());
pst_Admin.setString(2, moduleId);
rs_Admin = pst_Admin.executeQuery();

if (rs_Admin.next()) {

isAdmin = true;

}
} catch (Exception e) {
logger.error("Error in isAdmin() of EmployeeDAOIMPL:"
+ e.getMessage());
} finally {
Util.closeConnection(rs_Admin, pst_Admin, conn_Admin);
logger.debug("Exiting - isAdmin() of EmployeeDAOIMPL");
}
return isAdmin;
}
Hi Eric,

Thank you for moving this issue into Apache/Tomcat.
16 years ago
Hi Friends,

I am using Tomcat5.5.9 i am getting this error and i am unable to run the applicaitons. So please suggest me the solution for this.


Jun 12, 2007 7:35:30 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jun 12, 2007 7:35:30 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1719 ms
Jun 12, 2007 7:35:30 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jun 12, 2007 7:35:30 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
Jun 12, 2007 7:35:30 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
log4j:WARN No appenders could be found for logger (org.apache.catalina.session.M
anagerBase).
log4j:WARN Please initialize the log4j system properly.
[ INFO] 35:33 (DAOFactory.java:<init>:48)Inside the DAOFactory Class
Jun 12, 2007 7:35:33 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Jun 12, 2007 7:35:33 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/LMS] startup failed due to previous errors
log4j:WARN No appenders could be found for logger (org.apache.catalina.session.M
anagerBase).
log4j:WARN Please initialize the log4j system properly.
Jun 12, 2007 7:35:36 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jun 12, 2007 7:35:36 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jun 12, 2007 7:35:36 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/62 config=null
Jun 12, 2007 7:35:36 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Jun 12, 2007 7:35:37 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6952 ms
16 years ago
Ok, i will follow the mentioned rules. Thank you for suggesting tips.
i have form like this here the issue is :

Dynamic population of second list box based on the selection of first list box.
how can i do this one. please tell me the solution.


<form name="questionForm" method="post" action="listQuestions.lgs">
<table bgcolor="F8D8D8" cellspacing="2" cellpadding="2" align="center"
style="margin-top: 100px">

<tr>
<td>Topics:</td>
<td><select name="topic" onChange="loadCategories()">
<c:forEach items="${model.topics}" var="topic">
<option value="<c ut value="${topic.topicId}" />">
<c ut value="${topic.topicName}" /></option>
</c:forEach>
</select>
</td>
<td>Categories:</td>
<td><select name="category" onChange="loadQuestions()">
<c:forEach items="${model.categories}" var="category">
<option value="<c ut value="${category.categoryId}" />">
<c ut value="${category.categoryName}" /></option>
</c:forEach>
</select>
</td>
<tr>
<td><a
href="addQuestion.lgs?categoryId=2<c ut value="${category.categoryId}"/>">Add New Question</a></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Questions under this Category:</td>
<td><c:if test="${model.questions} == null">
<c ut value="no questions found" />
<br>
</c:if> <c:if test="${model.questions} != null">
<c:forEach items="${model.questions}" var="question">
<table>
<tr>
<c ut value="${question.questionDesc}" />
</tr>
</table>
</c:forEach>
</c:if></td>
</tr>
<tr>
<td colspan="2"><input type="submit" /></td>
</tr>
</table>
</form>
[ May 22, 2007: Message edited by: Bear Bibeault ]