Win a copy of Terraform in Action this week in the Cloud forum!

Shyam Kasthala

Ranch Hand
+ Follow
since Mar 30, 2006
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 Shyam Kasthala

Hi,
The following is my Stack trace.


Select query for deposit =select decode(trdh_sds_typ,'T', decode(sign(trdh_sw_effective_from - TO_DATE('31/03/2006','DD/MM/YYYY')), 1 , to_char(trdh_sw_effective_from,'DD-MON-YYYY'), to_char(nvl(trdh_repaid_dt,trdh_mat_dt),'DD-MON-YYYY') ), decode(trdh_repaid_dt, TO_DATE('31/03/2006','DD/MM/YYYY'), to_char(trdh_repaid_dt,'DD-MON-YYYY'), decode(sign(trdh_repaid_dt - TO_DATE('31/03/2006','DD/MM/YYYY')) , -1, to_char(trdh_repaid_dt,'DD-MON-YYYY'), to_char(trdh_mat_dt,'DD-MON-YYYY') ) ) ) TRDH_MAT_DT, to_char(TRDH_REPAID_DT, 'DD-MON-YYYY') TRDH_REPAID_DT from dealhdr_view where trdh_dl_no = getMaxDealNoAsOnDate ('B990004522', TO_DATE('31/03/2006','DD/MM/YYYY') )
2006-11-08 16:26:54:640 ERROR: lbs.reports.LBSRepCostBorrow: Exception while writting pdf =java.lang.IndexOutOfBoundsException: reserve - incorrect column/size
2006-11-08 16:26:54:718 DEBUG: lbs.reports.LBSRepCostBorrow: PDF123
2006-11-08 16:26:54:734 DEBUG: lbs.reports.LBSRepCostBorrowSearch: depositType =null
2006-11-08 16:26:54:734 DEBUG: lbs.reports.LBSRepCostBorrowSearch: dealType =null
2006-11-08 16:26:55:078 DEBUG: LBSREPServlet : inside REPMISPRN reports/LBSRepCostBorrowSearch.jsp


Thanks in advance.
15 years ago
hello,
i am trying to convert java to excel but i am getting the following error :

java.lang.IndexOutOfBoundsException : reserve - Incorrect column/size

Please help me out as soon as possible.Thanks in advance.
15 years ago
Hello,
It was asked in an interview recently?Please give me the answer?Thanks
15 years ago
Hello,
How to find the length of a String without using the length method.Please tell me.Thanks in advance.
15 years ago
Hello,
I have a JSP Registration page where the user inserts the username,password,address etc into the database.After submitting the page,the login page appears where i have to enter the username and password.Now i want to check the username and password i entered in the text boxes with the values in the database.I they match then the user should go the next page otherwise he should get an error msg.How should i validate it.Please some one give me the code for it.I have tried it in the servlet from the database side with the query as shown below but i am not able to get it.Is my query right?If not, how should i do it.If the query is right, where i am going wrong?please anyone tell me how can i do it from jsp?

"select * from mgsch.register where user_name='"+u+"' and pass_word='"+p+"' "

mgsch.register is the table where the i insert the values from the registration page.
Thank you.
15 years ago
JSP
Thanks for your reply.Now i got another problem.The following is my Action Class :


package app;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import org.apache.struts.util.*;
import javax.sql.*;
import java.sql.*;
import java.io.*;
import org.apache.commons.dbcp.BasicDataSource;
public class LoginAction extends Action
{
public ActionForward execute(ActionMapping mapping,ActionForm form,
HttpServletRequest request,HttpServletResponse response) throws Exception
{
DataSource dataSource;
Connection con = null;
try
{
dataSource = getDataSource(request);
con = dataSource.getConnection();
Statement st=con.createStatement();
ResultSet rs = st.executeQuery("select * from mgsch.login");
System.out.println("******************************************");
System.out.println("********Out Put from Login DataSource ******");
while(rs.next())
{
System.out.println("User Name is: " + rs.getString("user_name"));
}
System.out.println("******************************************");
rs.close();
st.close();
}
catch (SQLException sqle)
{
getServlet().log("Connection.process", sqle);
}
finally
{
try
{
con.close();
}
catch (SQLException e)
{
getServlet().log("Connection.close", e);
}
}
return mapping.findForward("success");
}
}

But it is not compiling.The error is :
Cannot resolve symbol
dataSource = getDataSource(request);

I have imported import javax.sql.*; and import org.apache.commons.dbcp.BasicDataSource; tto.
Please tell me where i am going wrong.My struts-config.xml is the same as above.Thanks in advance.
15 years ago
Sorry, I am getting the following error also :


java.lang.NoClassDefFoundError: org/apache/struts/legacy/GenericDataSource
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(Unknown Source)
java.security.SecureClassLoader.defineClass(Unknown Source)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1629)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:850)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1299)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:207)
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:231)
org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1079)
org.apache.struts.action.ActionServlet.init(ActionServlet.java:471)
javax.servlet.GenericServlet.init(GenericServlet.java:211)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)
15 years ago
Hi all,
I am facing a problem in connecting to the database(Postgresql).I have given the following in my struts-config.xml file :

<data-sources>
<data-source>
<set-property property="description" value="PostgreSQL Data Source"/>
<set-property property="driverClass" value="org.postgresql.Driver" />
<set-property property="username" value="shyam"/>
<set-property property="password" value="shyam"/>
<set-property property="url" value="jdbc ostgresql://192.168.15.105:5432/MGS"/>
</data-source>
</data-sources>

I am getting the following error :

javax.servlet.ServletException: Servlet.init() for servlet action threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)

Thanks in advance.
15 years ago
Hi all,
I have three JSP pages namely one.jsp,two.jsp, and three.jsp.In one.jsp i have username and password text field.I print the username in two.jsp using
<input type="text" name="username">
<input type="password" name="password">
String user = request.getParameter("username");
welcome , <%=user%>

I have two fields city and state in two.jsp
<input type="text" name="city">
<input type="text" name="state">
and a hidden field,
<input type="hidden" name="uname">

now, how can i print the same username in three.jsp also using hiddenfeilds.
Can anyone tell this for me.
how should i get the same username in the three.jsp
Thanks in advance.
15 years ago
JSP
Hi,
Can you tell me how should i set each input field dynamically.Thank you in advance.
15 years ago
JSP
Hi,
the number of text boxes depends on the columns of the field_activity_id.
15 years ago
JSP
Hi,
Here is the important Part of my code :-

<%
ResultSet rs1=st.executeQuery("select * from mgsch.actual where field_activity_id='"+actid+"'");
%>
<p align="center"><em><strong><font color="Green" size="+3"><strong>Measures
List</strong></font></em></p>
<table width="50%" border="0" align="center">
<%
int i = 0;
while(rs1.next())
{%>
<tr>
<td width="25%" align="center"><font color="Green"><strong><%=rs1.getString(2)%></strong></font></td>
<td width="25%" align="center"><input type="text" name="measure"></td>
</tr>
<%
i++;
}%>
</table>
15 years ago
JSP
Hello all,
I have a jsp page where i have a list box.when i select a value from the list box and submit it, i will get some names with text boxes with the same name to all associated with it.Now i wan to enter some value into the text box and submit it again.I have done all these appropriately but the first text box value is only passed.Now how can i pass the all the text box values to the next page.Please reply me.Thanks in advance.
15 years ago
JSP
Hello,
Can any one tell me how to use conditional operator(?) in javascript in window.location.Can any one tell me what this means : -

window.location="project.jsp?module="+document.frm.module.options[document.frm.module.selectedIndex].text;

I have 4 combo boxes where the second and third combo box values depend on the first combo box value and third combo box value depend on the second.I am able to write the code for the first half but struggling to write for the second half.

function getpname()
{
window.location="project.jsp?pid="+document.frm.pid.options[document.frm.pid.selectedIndex].text;
}
The above code is running fine.
But there is some problem in the following code that i am unable to understand.

function getsname()
{window.location="project.jsp?module="+document.frm.module.options[document.frm.module.selectedIndex].text;
}
All the combo boxes are in the same jsp page.
Please tell me how to use the conditional operator(?) with window.location.
Please solve this.Thank you.
Hi,
Sorry for delay.I have included the postgresql-8.1-407.jdbc3.jar file in my application's lib folder along with servlet-api.jar,jsp-api.jar,jdbc.jar . Just look at my program to connect to postgresql.

package project.mgs;
import java.sql.*;

public class MyDriver
{
public static Connection getConnection() throws Exception
{
Connection con=null;
try
{
Class.forName("org.postgresql.Driver");
con=DriverManager.getConnection("jdbc:postgresql://192.168.15.139:8080/MGS","username", "password");
return con;
}//try
catch (Exception e)
{
e.printStackTrace();
}//catch
return null;
}//getConnection
}//class


I am getting the error as follows : -

org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:117)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
at org.postgresql.Driver.connect(Driver.java:235)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at project.mgs.MyDriver.getConnection(MyDriver.java:12)
at org.apache.jsp.Project_jsp._jspService(org.apache.jsp.Project_jsp:47)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException
at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:243)
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:253)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:94)
... 29 more

Please tell me how to connect now. Thanks in advance.