Paramagurusamy Balasubramanian

Ranch Hand
+ Follow
since Aug 17, 2001
geocities.com
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 Paramagurusamy Balasubramanian

Hi,
There are plenty of 3rd party plug-ins available for parsing XML.Xerces from apache is one of the best parsers and it is open source too.
It provides rich set of libraries to do all kind of operations with XML.
Visit this URL for more details http://xml.apache.org/xerces-j/
Regards,
Paramaguru
15 years ago
JSP
Hi Shoaib,
This mechanism is known as paging.i.e Displaying only a limited amount of records in a page and set a link(either numbering or by having previous,next links)to view the rest.You can implement this method by passing SQL query to the database by providing parameters like From No.of records to To No.of records.i.e if you want to display from 1,10 then you could pass 1,10 in your query(This syntax may vary across databases).In oracle we could use the keyword 'TOP'.
The general formula for doing the above task is (n-1)*25+1,n*25 where n is the page number.If you want to display the first page then u have to display 1 to 25.So the value of n(page number) is 1 here.The formula may be included in the SQL query.
This may be executed by providing page number links like 1,2,3 etc.,and pass the corresponding number to the formula when clicking the link.
I hope this will give u an oral idea.
Thanks & Regards,
Paramagurusamy.
15 years ago
JSP
Hi gurus,
I have one application,which takes a field from database and submits to another server/system via HTTP URL interface.The database field may contain umlaut characters(coming under Latin char set).for eg.������ etc.,.If i take those values and submit it to other server/system then the value is not reaching the destination properly.It has some other values.But if i harcode these values in a string then its reaching fine..
what is the problem behind it?.should i need to change any system configuration.
Quick responses would be highly appreciated.
Thanks,
Paramaguru.
15 years ago
Dear Gurus,

I am doing Manipulation in the database by passing update query from my application.My back end is MySQL.

Say my Example Query is update <table_name> set timestamp=date_add(now(),interval '5:30' minute_second) where id=10;

The above query adds 5 minutes and 30 seconds to the timestamp of id's value is 10.
now() returns current date and time..Say for eg 2003-05-29 16:30:00.
so date_add will return 2003-05-29 22:00:00

i do like the following..

1 PreparedStatement psmt=con.preparedStatement("update table1 set timestamp=date_add(now(),interval '?:?' minute_second) where id=?");
2 psmt.setInt(1,5);
3 psmt.setInt(2,30);
4 psmt.setInt(3,10);
5 psmt.executeUpdate();

If i do the above task using PreparedStatement then i get ArrayIndexOutOfBoundsException(at line number 3).Pls advice how to proceed.

Thanks & Regards,
Paramaguru
Hi,
Pls.find the reply posted by me in this same topic dated sep 14 2001.
Hope that would help.
Best Regards,
Paramaguru
Hi,
Visit this for sample examples of XSLT. http://www.zvon.org/xxl/XSLTutorial/Books/Book1/
Best Regards,
Paramaguru
Hi everyone,
I've created a client socket..I've also created a server socket in servlet.I need to communicate that with a servlet..How can i achieve that?.How to give the host name inside the constructor of client socket?.is it "http://127.0.0.1:8080/servlet/servletfile".
If i give like this it throws unknownhostexception.how can i achieve my task?.
Early suggestions appreciated..
Best Regards,
Paramaguru
Thanks anubha..
Best Regards,
Paramaguru
17 years ago
Hi all,
can any one tell me how to do applet to jsp communication?.I've already done applet to servlet communication..It is working fine.
i.e.Write the object into servlet by using URLConnetion and ObjectOutputStream..I could read the object from the server in my applet too.
I've followed the same step in jsp too.But its giving FileNotFoundException error while reading the object from server.
Suggestions highly appreciated..
Thanks,
Best Regards,
Paramaguru.
17 years ago
Hi everyone,
Can anyone tell me who is providing free SMS server(like www.simplewire.com) to plugin our application?.
Early response will be highly appreciated..
Thanks,
Paramaguru.
Hi everyone,
Can anyone tell me who is providing free SMS server(like www.simplewire.com) to plugin our application?.
Early response will be highly appreciated..
Thanks,
Paramaguru.
17 years ago
Hi,
Sorry.I haven't tried this so far.I can give you the oral idea to do this.But i don't know whether it is suitable for your application.
Place this jsp/servlet file in the server where the xml file resides and try to open the file in write mode like this

FileOutputStream fos=new FileOutputStream("../sample.xml");
Now your updated contents can be written into the xml file which resides in the server..
Pardon me ,if this idea is helpless.
Best Regards,
Paramaguru.
hi,
visit these links for better understanding about xsl and Xpath with examples.
http://www.zvon.org/xxl/XPathTutorial/General/examples.html http://www.zvon.org/HTMLonly/XSLTutorial/Books/Book1/
Best Regards,
Paramaguru.
Hi,
I heard from sources that in future if the web related technogies boom up then XML will play a main role to accomplish all our tasks.As you know It acts as a layer between our application and the database.To do like this we can avoid network traffic and deal faster.

There are many parsers like xerces,jaxp etc.,available in the market.If we install those plug ins then we can do all necessary operations in our XML document according to our requirement. It all depends on you to use such parsers.

Java programmers may use parsers like jaxp,dom4j etc.,
Taglib programmers may use xtags.

These 3rd party plug in providers are focussing the type of programmers and giving their set of own APIs/packages or taglibs.
So programmers who are specialized in their areas can make use of those respective plug ins.

Best Regards,
Paramaguru
dear sharma,
Here i've furnished the sample code to achieve your task.I've done by using wml,jsp and xtags.
In these examples the msg.jsp file would parse the xml file and get the record id of the corresponding subject link..msg1.jsp gets the record id from msg.jsp and display the message..
msg.xml
-------
<?xml version="1.0"?>
<record>
<row>
<user>ajith</user>
<recordid>1</recordid>
<subject>Hello</subject>
<message>Welcome to java ranch</message>
</row>
<row>
<user>Maprapatu</user>
<recordid>2</recordid>
<subject>xml</subject>
<message>Welcome to xml discussion</message>
</row>
</record>
msg.jsp
-------
<%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags" %>
<%@ page language="java" contentType="text/vnd.wap.wml" %>
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>
<card id="card1" title="Products">

<xtags:parse url="http://localhost:8080/shop/msg.xml"/>
<p align="center" mode="nowrap">
Products Display

<table columns="2">
<tr>
<td>User</td>
<td>Subject</td>

</tr>
<xtags:forEach select="//row">
<xtags:variable id="rec_id" select="recordid"/>
<tr>
<td><xtags:valueOf select="user"/></td>
<td><a href="msg1.jsp?recordid=<%=rec_id%>"><xtags:valueOf select="subject"/></a></td>
</tr>
</xtags:forEach>
</table>

</p>
</card>
</wml>
msg1.jsp
--------
<%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags" %>
<%@ page language="java" contentType="text/vnd.wap.wml" %>
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>
<card id="card1" title="Message display">
<%
String recordid=request.getParameter("recordid");
%>
<xtags:parse url="http://localhost:8080/shop/msg.xml"/>
<p align="center" mode="nowrap">
Message Display<br/>
<xtags:forEach select="//row[recordid=$recordid]">
<xtags:valueOf select="message"/>
</xtags:forEach>

</p>
</card>
</wml>

Best Regards,
Parama guru.