<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE>@font-face {
font-family: MS Mincho;
}
@font-face {
font-family: Tahoma;
}
@font-face {
font-family: \@MS Mincho;
}
P.MsoNormal {
FONT-FAMILY: "Times New Roman"; FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt
}
LI.MsoNormal {
FONT-FAMILY: "Times New Roman"; FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt
}
DIV.MsoNormal {
FONT-FAMILY: "Times New Roman"; FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt
}
A:link {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline
}
P.MsoPlainText {
FONT-FAMILY: "Times New Roman"; FONT-SIZE: 12pt; MARGIN-LEFT: 0in; MARGIN-RIGHT: 0in
}
LI.MsoPlainText {
FONT-FAMILY: "Times New Roman"; FONT-SIZE: 12pt; MARGIN-LEFT: 0in; MARGIN-RIGHT: 0in
}
DIV.MsoPlainText {
FONT-FAMILY: "Times New Roman"; FONT-SIZE: 12pt; MARGIN-LEFT: 0in; MARGIN-RIGHT: 0in
}
SPAN.EmailStyle19 {
COLOR: navy; FONT-FAMILY: Arial
}
DIV.Section1 {
page: Section1
}
</STYLE>
</HEAD>
<BODY bgColor=white lang=EN-US link=blue vLink=purple>
<DIV><FONT color=#000080 face=Century size=2>Hello <A
href="mailto:richard_friedman@osadvisors.com"
title=richard_friedman@osadvisors.com>Richard</A>,</FONT></DIV>
<DIV><FONT color=#000080 face=Century size=2> </FONT></DIV>
<DIV><FONT color=#000080 face=Century size=2> Ok..Sorry for
just mistake.</FONT></DIV>
<DIV><FONT color=#000080 face=Century size=2> Now my problem
is solved.</FONT></DIV>
<DIV><FONT color=#000080 face=Century size=2> Thanks a
lot.........</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Century size=2><U>Mayur</U></FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000080 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A href="mailto:richard_friedman@osadvisors.com"
title=richard_friedman@osadvisors.com>Richard Friedman</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
href="mailto:opencms-dev@www.opencms.org"
title=opencms-dev@www.opencms.org>opencms-dev@www.opencms.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Saturday, October 19, 2002 5:15
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [opencms-dev] null?</DIV>
<DIV><BR></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">You initialized ret1
to null (ret1=null;) and within the loop you do ret1 = ret1 + row1.
First time throught ret1 is null.</SPAN></FONT></P>
<P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> </SPAN></FONT></P>
<P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">Initialize ret1 =
“”;</SPAN></FONT></P>
<P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> </SPAN></FONT></P>
<P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">-Rich.</SPAN></FONT></P>
<P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> </SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Tahoma size=2><SPAN
style="FONT-FAMILY: Tahoma; FONT-SIZE: 10pt">-----Original
Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> <A
href="mailto:owner-opencms-dev@www.opencms.org">owner-opencms-dev@www.opencms.org</A>
[<A
href="mailto:owner-opencms-dev@www.opencms.org">mailto:owner-opencms-dev@www.opencms.org</A>]
<B><SPAN style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Mayur
Solanki<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Saturday,
October 19, 2002 5:45 AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B>
<A
href="mailto:opencms-dev@www.opencms.org">opencms-dev@www.opencms.org</A><BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> [opencms-dev]
null?</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT></P>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT color=navy face=Arial
size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">Hello,</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT color=navy face=Arial
size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> Connceted
MySQL in OpenCms well.</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT color=navy face=Arial
size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">
My JDBC - MySQL connectivity works well but small problem
arise...</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT color=navy face=Arial
size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> When I
fetched the data from table (here "test").....</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT color=navy face=Arial
size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> Definite
I found the dataset(records) but I also found in the front of template
"null".</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT color=navy face=Arial
size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> I don't
guess it!</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT color=navy face=Arial
size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> I
fetched the dataset in template via Object, my sample java code is
here.</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT color=navy face=Arial
size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> ////////
javacode ////////////////// </SPAN></FONT></P></DIV>
<P class=MsoPlainText style="MARGIN-LEFT: 0.5in"><FONT color=navy face=Arial
size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">import
com.opencms.file.*;<BR>import com.opencms.core.*;<BR>import
com.opencms.template.*;<BR>import com.opencms.defaults.*;<BR>import
com.opencms.file.mySql.*;<BR><BR>import java.sql.*;<BR>import
java.lang.*;<BR>import java.util.*;<BR><BR>public class con extends
CmsXmlTemplate<BR>{<BR><BR>
public Object getDataset1(CmsObject cms, String tagcontent,
<BR>
A_CmsXmlContent doc, Object userObject)<BR>
throws CmsException
{<BR>
<BR><BR>
Connection con1 =
null;<BR>
PreparedStatement statement1 =
null;<BR>
ResultSet res1 =
null;<BR>
String poolname1 =
"jdbc:opencmspool:mysql";<BR>
String ret1 =
null;<BR>
String f2,f3,f4 =
null;<BR>
String row1 =
null;<BR>
final String SELECT = "select * from
test";<BR><BR>
CmsXmlTemplateFile template1 =
(CmsXmlTemplateFile)doc;<BR><BR>
try
{<BR>
con1 =
DriverManager.getConnection(poolname1);<BR>
statement1 =
con1.prepareStatement(SELECT);<BR>
res1 =
statement1.executeQuery();<BR>
<BR>
while(res1.next()){<BR>
// read the items from the
resultset<BR>
f2 =
res1.getString(1);<BR>
f3 =
res1.getString(2);<BR>
f4 =
res1.getString(3);<BR><BR>
template1.setData("name",
f2);<BR>
template1.setData("email",
f3);<BR>
template1.setData("phone",
f4);<BR><BR>
row1 =
template1.getProcessedDataValue("row1");<BR>
ret1= ret1 +
row1;<BR>
}<BR>
}catch(SQLException e)
{<BR>
//
exception-handling<BR>
}finally{<BR>
try{<BR>
res1.close();<BR>
}catch (Exception exc)
{<BR>
// ignore this
exception<BR>
}<BR>
<BR>
try{<BR>
statement1.close();<BR>
} catch(Exception exc)
{<BR>
// ignore the
exception<BR>
}<BR>
<BR>
try{<BR>
con1.close();<BR>
} catch(Exception exc)
{<BR>
// ignore the
exception<BR>
}<BR>
}<BR><BR>
return ret1;<BR>
}<BR><BR><BR>}<BR><BR> ///////////// End javacode
////////////////////////</SPAN></FONT></P>
<P class=MsoPlainText style="MARGIN-LEFT: 0.5in"><FONT color=navy face=Arial
size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">I have
already "test" table with three fields : 1) name 2) email 3)
phone (All are String).</SPAN></FONT></P>
<P class=MsoPlainText style="MARGIN-LEFT: 0.5in"><FONT color=navy face=Arial
size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">Please
give me ideas that when I go wrong!.... Advanced
thanks....</SPAN></FONT></P>
<P class=MsoPlainText style="MARGIN-LEFT: 0.5in"><FONT color=navy
face="Times New Roman" size=3><SPAN
style="COLOR: navy; FONT-SIZE: 12pt"> </SPAN></FONT></P>
<P class=MsoPlainText style="MARGIN-LEFT: 0.5in"><STRONG><B><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">M.
Solanki.</SPAN></FONT></B></STRONG></P></DIV></BLOCKQUOTE></BODY></HTML>