Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!

Seenu Reddy

Ranch Hand
+ Follow
since Apr 03, 2002
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 Seenu Reddy

Hi All,
I have java source code in default package. This application is written in early 2001. These classes are used by the JSPs in application. Now we are upgrading the application to web sphere 6.0. I think Web sphere container will not recognize the source code in default package since it uses JDK1.4. I can't move these classes in to packages bcz it is using the third party jar files which has files in default package. How can my JSP import java classes from the default package without problem?

Thanks for your help!

Bye,
Seenu
14 years ago
JSP
Hi All,
I have java source code in default package. This application is written in early 2001. These classes are used by the JSPs in application. Now we are upgrading the application to web sphere 6.0. I think Web sphere container will not recognize the source code in default package since it uses JDK1.4. I can't move these classes in to packages bcz it is using the third party jar files which has files in default package. How can my JSP import java classes from the default package without problem?

Thanks for your help!

Bye,
Seenu
We have problem while Tag library application upgraded from Websphere3.5 to Websphere6. The Tag library looks in JSP has follows.

<database:query id='headers' scope='application'>
SELECT <%=report.getColumnName()%> Product, hdr_desc_txt Header, hdr_cd Action FROM <%=report.getReportType()%>_HDR_VIEW where <%=report.getColumnName()%>='<%=report.getProduct()%>'
</database:query>

In above query the dynamic values are populating correctly and become complete valid query while executing in the JSP. Problem only when this query set into BodyContent class by the Tag libraries the query become

SELECT <jsp:expression></jsp:expression> Product, hdr_desc_txt Header, hdr_cd Action FROM <jsp:expression></jsp:expression>_HDR_VIEW where <jsp:expression></jsp:expression>='<jsp:expression></jsp:expression>'

In above query the original value by <%=report.getColumnName()%> is replacing with value <jsp:expression></jsp:expression>. That is the reson I am getting JDBC errors. I have upgraded the .tld version to 1.2 and tested, but it has the same errors. I think there is some problem while executing setBodyContent() in BodyTagSupport class by web sphere runtime environment.

Do you guys have any idea about this error? Please let me know? My code is below.

QueryTag.java
----------------
package tags.jdbc;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;

import beans.jdbc.Query;

import com.lincolnlife.services.AWPUtils;


public class QueryTag extends BodyTagSupport implements Constants {
private String scope = "page";
private boolean update = false, driverLoaded = false;

public void setId(String id) {
this.id = id;
}
public void setScope(String scope) {
this.scope = scope;
}
public void setUpdate(boolean update) {
this.update = update;
}
public int doEndTag() throws JspException {
Connection conn = null;

try {

conn = (Connection)AWPUtils.getConnection();
}
catch(Exception cex) {
throw new JspException(cex.getMessage());
}

if(bodyContent != null) {
try {
String query = bodyContent.getString();
System.out.println("query: " + query);
Statement statement = conn.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet rs = null;
int rows = 0;

if(update) {
rows = statement.executeUpdate(query);
Query.save(new Query(statement, rows),
pageContext, id, scope);
}
else {
rs = statement.executeQuery(query);
Query.save(new Query(statement, rs),
pageContext, id, scope);
}
}
catch(SQLException ex) {
throw new JspException(ex.getMessage());
}
}
return EVAL_PAGE;
}
}
Database.tld
--------------

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag
Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">


<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>Sun Microsystems Press Tag library</shortname>
<tag>
<name>show_table</name>
<tagclass>tags.jdbc.ShowTableTag</tagclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>query</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>database</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>border</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>cellPadding</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>transaction</name>
<tagclass>tags.jdbc.TransactionTag</tagclass>
<bodycontent>tagdependent</bodycontent>
<attribute>
<name>file</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>prepareStatement</name>
<tagclass>tags.jdbc.PrepareStatementTag</tagclass>
<bodycontent>tagdependent</bodycontent>
<attribute>
<name>scope</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>id</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

</tag>
<tag>
<name>executePreparedStatement</name>
<tagclass>tags.jdbc.ExecutePreparedStatementTag</tagclass>
<bodycontent>None</bodycontent>
<attribute>
<name>id</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>scope</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>variables</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>update</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

</tag>
<tag>
<name>query</name>
<tagclass>tags.jdbc.QueryTag</tagclass>
<bodycontent>tagdependent</bodycontent>
<attribute>
<name>id</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>scope</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>update</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>rows</name>
<tagclass>tags.jdbc.RowsTag</tagclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>query</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>startRow</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>endRow</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>columnNames</name>
<tagclass>tags.jdbc.ColumnNamesTag</tagclass>
<teiclass>tags.jdbc.ColumnNamesTagInfo</teiclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>query</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>id</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>columns</name>
<tagclass>tags.jdbc.ColumnsTag</tagclass>
<teiclass>tags.jdbc.ColumnsTagInfo</teiclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>query</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>columnValue</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>columnName</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

</tag>
<tag>
<name>release</name>
<tagclass>tags.jdbc.ReleaseTag</tagclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>query</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>
14 years ago
JSP
VK,
Congrts and this is very good score.Keep it up.
What's your next plans???
15 years ago
Ikenna Nwaiwu,
Don't worry, best of luck for next time!
prepare well and be relaxed while going to the exam.
15 years ago
thangvu,
Congrats! This is great achivement. keep it up!!!
15 years ago
Varun Ratra,

This book not contains the CD but you can download the code examples from manning.com website.
Hi Guys,
Thanks for your suggestions.
Today i will own the HF book. I already bought the SCWCD study kit and i use it as refrence.
if you have any more suggestions on SCWCD exam, you are most welcome.
[ November 17, 2005: Message edited by: Seenu R ]
Hi,
Which book is good for SCWCD 1.4 exam? i have good experience in web technologies.
Give your valuable suggestion which below book is good.

1)SCWCD Exam Study Kit 2nd Ed.
2)Head First Servlets and JSP
Swati,

Check the following link for SCBCD resources:
http://www.valoxo.ch/jr/SCBCD_Links.html

If you have EJB work experience , i think 1 month is enough to pass the exam.
15 years ago
Srikanth,

Check the following link for the SCWCD details: http://www.javaranch.com/scwcdlinks.jsp

I think you can choose either HFBook or SCWCD study kit book to clear the SCWCD exam.
S.L.Narayana,

Congrats and Good Score.
15 years ago
sameer kumar,

Congrtas and good job!
15 years ago
krisykc krisykc,

SCJP1.4 by Khalid Mughal and its 2nd version.

Thanks,
Seenu
15 years ago
Mel Edwards,

Congrats and its Very good score.
15 years ago