Problem while querying MS Acess DB through JAVA

Hi,
I am using a query as follows:
strQuery = "select * from A where UID=?";
//have set the parameter
resultSet = ps.executeQuery();
sysout(resultSet);//printing resultSet Object
if(null != resultSet)
//have created object of class UsrDetails
UsrDetails u =new UsrDetails();
while(resultSet.next())
sysout(resultSet);//printing resultSet Object again
//set the values for UsrDetails.
I hve given uid which is not present in the table A. Now the first sysout is getting printed(not null) but the control is not going into while i.e second sysout is not getting printed.
I don't know why this is happening. I guess I shld get null if the rcrd is not present in the DB.

chasan wrote:
ResultSet is not null if the number of rows returned is zero.
Try replacing if(null != resultSet) with if(resultSet.next())
Wrong. The correct idiom is:
while (resultSet.next())
    // process the results in here.
}>
Then if it enters the if block invoke resultSet.previous() so that the first record is not lost.Nonsense. The first record isn't lost. This is poor advice from start to finish.
%

Similar Messages

  • Having problem while connecting to SQL Server through a application

    hi guys ,
    having one problem while connecting to the SQL SERVER 2008 R2 through a application (Dynamics NAV), by using the concept of Linked Server.
    But one more thing , i am able to access that very SQL server through my app , when i am working locally , i mean to say that when i am working on the machine itself on which the server is installed then its working fine .
    But when i am working on another system the query doesn't work.

    by using the concept of Linked Server.
    Why through a linked server and not directly as a simple remote connection? I don't think you app is aware of linked server.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Problem in executing a unix command through java

    hi
    i'm trying to execute unix command through java
    simple shell command like "ls -l >test " but i'm not able to see the result.
    there are no error messages.
    Code is:
    import java.lang.Runtime.*;
    class ExecDemo
         public static void main(String[] args)
              Runtime r=Runtime.getRuntime();
              Process p=null;
              try
                   p=r.exec("ls -l > test");
              catch (Exception e)
                   System.out.println("Error executing nedit.");
    }can anyone help please.

    get the the inputStream of the runtime object after executing the command.
    now use the readLine() function until it becomes null.
    egs: with reference to ur code.
    InputStream is=p.getInputStream()
    while(is!=null)
    String s=is.readLine();
    if the command don't execute try giving the full path also like /sbin/ls -l

  • Getting problem when connecting to SMTP server through java code

    Hi all,
    I am getting problem when i am going to connect with "Kerio SMTP server" through java code. The error what i am getting is :
    "[16/Sep/2008 15:59:09] Sent: Queue-ID: 48cf8a73-000000f9, Recipient: <[email protected]>, Result: failed, Status: 5.3.2 554 5.0.0 Too many hops (101, max 100), message looping" when sending an email from [email protected]

    Looks like something is set up wrong on your server that's causing messages
    to be forwarded around a loop too many times without ever reaching the destination.
    For instance, if server A forwards to server B, and server B forwards to server A,
    this would happen.

  • Problems while consuming a web-service through Netweaver using VPN

    Hi all
    I'm facing a problem while I'm attempting to consume a .NET web-service that is located in a remote server. We've estabished a VPN connection between our Netweaver CE in Linux to the remote office where the web-service is running.
    The problem is, when my application running in Netweaver tries to consume the webservice, it takes the external access to try to reach the webservice URL instead of take the VPN route to do that. ie. my application find an external IP of the webservice instead of finding the internal IP.
    When I ping the webservice URL in linux, it brings me the internal IP, but for some unknown reason, the Netweaver don't find the correct route to reach the webservice.
    Does anyone have any idea or suggestion on what to do?
    Thanks in advance!

    > The problem is, when my application running in Netweaver tries to consume the webservice, it takes the external access to try to reach the webservice URL instead of take the VPN route to do that. ie. my application find an external IP of the webservice instead of finding the internal IP.
    You're using a proxy?
    Markus

  • Problem while querying from java

    I have a query like this ...
    Select name,description,start_date from Events where TO_CHAR(start_date,'MM/DD/YYYY')='09/19/2004';
    I want to execute the same query using java for which i say
    String QQQ="Select name,description,start_date from Events where TO_CHAR(start_date,'MM/DD/YYYY')='?/?/?'"
    PreparedStatement stmt = conn.prepareStatement(QQQ);
    stmt.setString(1,"09");
    stmt.setString(2,"27");
    stmt.setString(3,"2004");
    But I am not getting the results. Is there anything wrong with the Qusetion marks(?) in the query ?
    I get the results if i directly enter the value for the question mark.
    Please help.
    Thanks.

    Date date = get a Date object somehow, perhaps from SimpleDateFormat.parse()
    String query = "Select name,description,start_date from Events where start_date = ?";
    PreparedStatement ps = con.prepareStatement(query);
    ps.setDate(1, date);
    ps.executeQuery();

  • Problem while access database by JSTL through JSP.

    I am trying to connect database by using JSTL through jsp.I am getting an exception.Please advise.
    Error:
    org.apache.jasper.JasperException: XML parsing error on file /WEB-INF/jsp/c.tld: (line 2, col 8): Document is invalid: no grammar found.
         at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:140)
         at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:200)
         at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:140)
         at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:309)
         at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:336)
         at org.apache.jasper.compiler.Parser.parseElements(Parser.java:750)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:77)
         at org.apache.jasper.compiler.ParserController.parse(ParserController.java:157)
         at org.apache.jasper.compiler.ParserController.parse(ParserController.java:111)
         at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:183)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:427)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:142)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:445)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:534)
    JSP:
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
    <sql:setDataSource scope="application"
    driver="sun.jdbc.odbc.JdbcOdbcDriver"
    url="jdbc:oracle:thin:@3.173.130.12:1521:cup"
    user="sUerName"
    password="sPassword"
    />
    <sql:query var="Result">
    select * from imtinv.imi_error_message
    </sql:query>
    <html>
    <head>
    <title>
    Error Message Details
    </title>
    </head>
    <body bgcolor="white">
    This is the information stored in the Error Message Table in Depot Automation Systems
    <table>
    <c:forEach items="$(Result.rows)" var="row">
    <c:forEach items="$(rows)" var="column">
    <tr>
    <td align=right>
    <b><c:out value="$(column.key)" />:</b>
    </td>
    <td>
    <c:out value="$(column.value)" />:</b>
    </td>
    </tr>
    </c:forEach>
    </c:forEach>
    </table>
    </body>
    </html>
    Web.xml:
    <taglib>
    <taglib-uri>
    http://java.sun.com/jstl/xml
    </taglib-uri>
    <taglib-location>
    /WEB-INF/jsp/x.tld
    </taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>
    http://java.sun.com/jstl/fmt
    </taglib-uri>
    <taglib-location>
    /WEB-INF/jsp/fmt.tld
    </taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>
    http://java.sun.com/jstl/sql
    </taglib-uri>
    <taglib-location>
    /WEB-INF/jsp/sql.tld
    </taglib-location>
    </taglib>
    c.tld:
    <?xml version="1.0" encoding="UTF-8" ?>
    <taglib xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
    version="2.0">
    <description>JSTL 1.1 core library</description>
    <display-name>JSTL core</display-name>
    <tlib-version>1.1</tlib-version>
    <short-name>c</short-name>
    <uri>http://java.sun.com/jsp/jstl/core</uri>
    <validator>
    <description>
    Provides core validation features for JSTL tags.
    </description>
    <validator-class>
    org.apache.taglibs.standard.tlv.JstlCoreTLV
    </validator-class>
    </validator>
    <tag>
    <description>
    Catches any Throwable that occurs in its body and optionally
    exposes it.
    </description>
    <name>catch</name>
    <tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class>
    <body-content>JSP</body-content>
    <attribute>
    <description>
    Name of the exported scoped variable for the
    exception thrown from a nested action. The type of the
    scoped variable is the type of the exception thrown.
    </description>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <description>
    Simple conditional tag that establishes a context for
    mutually exclusive conditional operations, marked by
    <when> and <otherwise>
    </description>
    <name>choose</name>
    <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class>
    <body-content>JSP</body-content>
    </tag>
    <tag>
    <description>
    Simple conditional tag, which evalutes its body if the
    supplied condition is true and optionally exposes a Boolean
    scripting variable representing the evaluation of this condition
    </description>
    <name>if</name>
    <tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class>
    <body-content>JSP</body-content>
    <attribute>
    <description>
    The test condition that determines whether or
    not the body content should be processed.
    </description>
    <name>test</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    <type>boolean</type>
    </attribute>
    <attribute>
    <description>
    Name of the exported scoped variable for the
    resulting value of the test condition. The type
    of the scoped variable is Boolean.
    </description>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Scope for var.
    </description>
    <name>scope</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <description>
    Retrieves an absolute or relative URL and exposes its contents
    to either the page, a String in 'var', or a Reader in 'varReader'.
    </description>
    <name>import</name>
    <tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class>
    <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class>
    <body-content>JSP</body-content>
    <attribute>
    <description>
    The URL of the resource to import.
    </description>
    <name>url</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Name of the exported scoped variable for the
    resource's content. The type of the scoped
    variable is String.
    </description>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Scope for var.
    </description>
    <name>scope</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Name of the exported scoped variable for the
    resource's content. The type of the scoped
    variable is Reader.
    </description>
    <name>varReader</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Name of the context when accessing a relative
    URL resource that belongs to a foreign
    context.
    </description>
    <name>context</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Character encoding of the content at the input
    resource.
    </description>
    <name>charEncoding</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <description>
    The basic iteration tag, accepting many different
    collection types and supporting subsetting and other
    functionality
    </description>
    <name>forEach</name>
    <tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class>
    <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class>
    <body-content>JSP</body-content>
    <attribute>
    <description>
    Collection of items to iterate over.
    </description>
    <name>items</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <type>java.lang.Object</type>
    </attribute>
    <attribute>
    <description>
    If items specified:
    Iteration begins at the item located at the
    specified index. First item of the collection has
    index 0.
    If items not specified:
    Iteration begins with index set at the value
    specified.
    </description>
    <name>begin</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <type>int</type>
    </attribute>
    <attribute>
    <description>
    If items specified:
    Iteration ends at the item located at the
    specified index (inclusive).
    If items not specified:
    Iteration ends when index reaches the value
    specified.
    </description>
    <name>end</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <type>int</type>
    </attribute>
    <attribute>
    <description>
    Iteration will only process every step items of
    the collection, starting with the first one.
    </description>
    <name>step</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <type>int</type>
    </attribute>
    <attribute>
    <description>
    Name of the exported scoped variable for the
    current item of the iteration. This scoped
    variable has nested visibility. Its type depends
    on the object of the underlying collection.
    </description>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Name of the exported scoped variable for the
    status of the iteration. Object exported is of type
    javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested
    visibility.
    </description>
    <name>varStatus</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <description>
    Iterates over tokens, separated by the supplied delimeters
    </description>
    <name>forTokens</name>
    <tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class>
    <body-content>JSP</body-content>
    <attribute>
    <description>
    String of tokens to iterate over.
    </description>
    <name>items</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    <type>java.lang.String</type>
    </attribute>
    <attribute>
    <description>
    The set of delimiters (the characters that
    separate the tokens in the string).
    </description>
    <name>delims</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    <type>java.lang.String</type>
    </attribute>
    <attribute>
    <description>
    Iteration begins at the token located at the
    specified index. First token has index 0.
    </description>
    <name>begin</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <type>int</type>
    </attribute>
    <attribute>
    <description>
    Iteration ends at the token located at the
    specified index (inclusive).
    </description>
    <name>end</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <type>int</type>
    </attribute>
    <attribute>
    <description>
    Iteration will only process every step tokens
    of the string, starting with the first one.
    </description>
    <name>step</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <type>int</type>
    </attribute>
    <attribute>
    <description>
    Name of the exported scoped variable for the
    current item of the iteration. This scoped
    variable has nested visibility.
    </description>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Name of the exported scoped variable for the
    status of the iteration. Object exported is of
    type
    javax.servlet.jsp.jstl.core.LoopTag
    Status. This scoped variable has nested
    visibility.
    </description>
    <name>varStatus</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <description>
    Like <%= ... >, but for expressions.
    </description>
    <name>out</name>
    <tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class>
    <body-content>JSP</body-content>
    <attribute>
    <description>
    Expression to be evaluated.
    </description>
    <name>value</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Default value if the resulting value is null.
    </description>
    <name>default</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Determines whether characters <,>,&,'," in the
    resulting string should be converted to their
    corresponding character entity codes. Default value is
    true.
    </description>
    <name>escapeXml</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <description>
    Subtag of <choose> that follows <when> tags
    and runs only if all of the prior conditions evaluated to
    'false'
    </description>
    <name>otherwise</name>
    <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class>
    <body-content>JSP</body-content>
    </tag>
    <tag>
    <description>
    Adds a parameter to a containing 'import' tag's URL.
    </description>
    <name>param</name>
    <tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class>
    <body-content>JSP</body-content>
    <attribute>
    <description>
    Name of the query string parameter.
    </description>
    <name>name</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Value of the parameter.
    </description>
    <name>value</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <description>
    Redirects to a new URL.
    </description>
    <name>redirect</name>
    <tag-class>org.apache.taglibs.standard.tag.rt.core.RedirectTag</tag-class>
    <body-content>JSP</body-content>
    <attribute>
    <description>
    The URL of the resource to redirect to.
    </description>
    <name>url</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Name of the context when redirecting to a relative URL
    resource that belongs to a foreign context.
    </description>
    <name>context</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <description>
    Removes a scoped variable (from a particular scope, if specified).
    </description>
    <name>remove</name>
    <tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class>
    <body-content>empty</body-content>
    <attribute>
    <description>
    Name of the scoped variable to be removed.
    </description>
    <name>var</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Scope for var.
    </description>
    <name>scope</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <description>
    Sets the result of an expression evaluation in a 'scope'
    </description>
    <name>set</name>
    <tag-class>org.apache.taglibs.standard.tag.rt.core.SetTag</tag-class>
    <body-content>JSP</body-content>
    <attribute>
    <description>
    Name of the exported scoped variable to hold the value
    specified in the action. The type of the scoped variable is
    whatever type the value expression evaluates to.
    </description>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Expression to be evaluated.
    </description>
    <name>value</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Target object whose property will be set. Must evaluate to
    a JavaBeans object with setter property property, or to a
    java.util.Map object.
    </description>
    <name>target</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Name of the property to be set in the target object.
    </description>
    <name>property</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Scope for var.
    </description>
    <name>scope</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <description>
    Creates a URL with optional query parameters.
    </description>
    <name>url</name>
    <tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class>
    <body-content>JSP</body-content>
    <attribute>
    <description>
    Name of the exported scoped variable for the
    processed url. The type of the scoped variable is
    String.
    </description>
    <name>var</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Scope for var.
    </description>
    <name>scope</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    URL to be processed.
    </description>
    <name>value</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
    <description>
    Name of the context when specifying a relative URL
    resource that belongs to a foreign context.
    </description>
    <name>context</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
    <tag>
    <description>
    Subtag of <choose> that includes its body if its
    condition evalutes to 'true'
    </description>
    <name>when</name>
    <tag-class>org.apache.taglibs.standard.tag.rt.core.WhenTag</tag-class>
    <body-content>JSP</body-content>
    <attribute>
    <description>
    The test condition that determines whether or not the
    body content should be processed.
    </description>
    <name>test</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    <type>boolean</type>
    </attribute>
    </tag>
    </taglib>
    Thanks and Regards,
    Velrajan T.

    For installing JSTL, all you need are the jar files in the web-inf/lib directory.
    - No entries in web.xml
    - no tld files lying around
    - no problems!
    I think you may have a versioning problem here.
    What version of Tomcat are you using?
    With JSP1.2 (eg Tomcat 4), you should be using JSTL1.0. <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    With JSP2.0 (eg Tomcat 5), you should use JSTL1.1. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    Note the difference in the URIs. - the second one includes a /jsp
    Currently you are using the URI for JSTL1.0, but you look to have the tld from JSTL1.1. If you are using a JSP1.2 container, I don't think it could read this tld file, hence the error.
    Try installing the correct version of JSTL, properly (ie as they tell you in the readme file) and it should all work.
    Cheers,
    evnafets

  • Problem while Calling a CGI pgm From Java with code sample

    Hey guys,
    I am calling a CGI program from java servlet, while calling cgi program I am passing encoded(Base64) content via post process,
    My problem is the encoded data is not posted as expected, the encoded data is corrupting. But when I send encoded data in a text file, cgi program is perfectly decoding and working fine.
    Here I am doing Base64 encoding as per requirement, I cannot avoid this encoding.
    My doubt is about OutputStreamWriter constructor argument , In OutputStream Constructor I am passing one argument is OutputStream object and another argument is encoding type. I tried with ASCII, US-ASCII & UTF-8 .
    My code is as follows, please help me to resolve this issue.
    URL url = new URL("CGI server path");
    URLConnection urlConnection = url.openConnection();
    urlConnection.setDoOutput(true);
    OutputStream os = urlConnection.getOutputStream();
    BufferedOutputStream buffer = new BufferedOutputStream(os);
    OutputStreamWriter  writer = new
                                                   OutputStreamWriter(buffer, "US-ASCII");
    writer.write(encodedPDF-Content);
    writer.write("\r\n");
    writer.flush();
    writer.close();
    here encodedPDF-Content is String and it's size is 9565 bytes

    Whenever you read something in java into string (with Reader implementation) it expects source to contain text in encoding you specified. It then decodes it and makes 16 bit unicode string from it. Whenever you store string using Writers it does reverse operation with specified encoding (may be different than this which you used to read source) and stores text as a sequence of bytes made of 16 bit unicode string. So, passing text back and forth between programs with the help of files or I/O you can make mistake at both reading and writing encoding. Check for it.
    Now, when C programm or other application reads file it may take another assumptions about encoding or may even completly ignore it and read source as a binary file. Then, if you have a source text as a file and have to pass it to other application never do it using Reader/Writer. User raw InputStream/OutputStream instead what will preserve all information unchanged.
    here encodedPDF-Content is String and it's size is 9565 byteHow id you get this info? String.length() gets you how many chars is in it, it will be half the number of bytes. If you see your input file beeing 9565 bytes long, see my above statements.

  • (Class cast Exception)Problem while loading data fro database in java class

    Dear all,
    Please help me...to solve this
    I have a database having two columns of String and Date Types.
    In my java code i was trying to load the data to a UI.
    I am successfull in loading the String type value.
    But while loading date field value,is showing Class cast Exception.
    What i am doing is Getting the values from database to a String[] array.
    So my question is how to
    get the Date field as date field itself,Then convert it to a String..Then put it in to String[] array...
    Any body please help...If any one want more clarification in question i will give......

    Hi,
    I am using GWT to display my data in a Grid.
    So it will accept a Single two dimensional String array....Here i have one as String and other as Date.
    So i was trying to get each row in a sindle dimensional array array[] then store it in a list.
    Iteration goes up to 10 rows.After i am setting it in to a list
    ie list.add(array);
    Now while returning this list i am doing this
    "return (String[][])list.toArray(new String[0][]);"
    When i tried to get the date element to String array it is showing class cast exception. When i tried with toString() method it is showing the same problem.

  • Problem while connecting to business one through webservice

    Hi All,
         I have written a client java program program to connect to Business One remotely through jndi lookup.
    when i have written the same code for a session bean and
    i have created a webservice for session bean and delpoyed it in WAS.And when i run this webservice it is
    simply throwing an exception saying that Exception in
    method name.
         I have placed OBSERVERDLL.dll file in System32.I have placed this becuase it  is helpful dll file to connect to Business One.
         Is it a problem of WAS.I am unable to connect to business one when i create a webservice and run it.
    please help me rgarding this.Its urgent requirement
    Thanks & Regards,
    Guru

    Hi Suresh,
       There is no problem in EJB or webservice,when i am passing just connection parameters to connect to business one and when i am running this webservice it is
    simply giving "Exception in method b1tomas_downloadSalesDelivery.".
       once i have connected through a webservice to business one.But the System is formatted and i reloaded the WAS.Now i am getting as "Exception in method b1tomas_downloadSalesDelivery."
       please send me a reply soon.Its urgent

  • Problem while calling RFC function module in java

    Hi all
    com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed
    Connect_PM  GWHOST=<system.ab.ydydy.yyyd.com>, GWSERV=sapgw00, ASHOST=<system.ab.ydydy.yyyd.com>, SYSNR=00
    LOCATION    CPIC (TCP/IP) on local host
    ERROR       hostname '<system.ab.ydydy.yyyd.com>' unknown
    TIME        Mon Jun 06 14:50:25 2005
    RELEASE     640
    COMPONENT   NI (network interface)
    VERSION     37
    RC          -2
    MODULE      ninti.c
    LINE        332
    DETAIL      NiPGetHostByName2: hostname '<system.ab.ydydy.yyyd.com>' not found
    SYSTEM CALL gethostbyname_r
    COUNTER     1
         at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
         at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:1098)
         at com.sap.mw.jco.JCO$Client.connect(JCO.java:2983)
         at MyProject.Bapi2.<init>(Bapi2.java:43)
         at MyProject.Bapi2.main(Bapi2.java:231)
    Pl help me
    pradeep

    Hi
    This is my code....
    Created on Jun 2, 2005
    To change the template for this generated file go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    package MyProject;
    @author pradeep
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    import com.sap.mw.jco.*;
    public class Bapi2 extends Object {
       JCO.Client mConnection;
       JCO.Repository mRepository;
       public Bapi2() {
           try {
              // Change the logon information to your own system/user
              mConnection =
                JCO.createClient("122", // SAP client
                   "<pradeep>", // userid
                   "*****", // password
                   "EN", // language
                   "<abc11.aa.abc23.company.com>", // application server host name
                   "<00>");//system no
              mConnection.connect();
              mRepository = new JCO.Repository("HLL", mConnection);
          catch (Exception ex) {
            ex.printStackTrace();
            System.exit(1);
          JCO.Function function = null;
          JCO.Table codes = null;
            try {
               function = this.createFunction("BAPI_COMPANYCODE_GETLIST");
               if (function == null) {
                 System.out.println("BAPI_COMPANYCODE_GETLIST" +
                                         " not found in SAP.");
                 System.exit(1);
               mConnection.execute(function);
               JCO.Structure returnStructure =
                 function.getExportParameterList().getStructure("RETURN");
               if (! (returnStructure.getString("TYPE").equals("") ||
                        returnStructure.getString("TYPE").equals("S")) ) {
                 System.out.println(returnStructure.getString("MESSAGE"));
                 System.exit(1);
               codes =
                 function.getTableParameterList().getTable("COMPANYCODE_LIST");
               codes.setRow(2);
    codes.deleteRow();
    codes.deleteRow(5);
    codes.appendRow();
    codes.setValue("XXXX", "COMP_CODE");
    codes.setValue("Does not exist", "COMP_NAME");
    codes.appendRows(2);
    codes.setValue("YYYY", "COMP_CODE");
    codes.setValue("Does not exist either", "COMP_NAME");
    codes.nextRow();
    codes.setValue("ZZZZ", "COMP_CODE");
    codes.setValue("Nor does this", "COMP_NAME");
    for (int i = 0; i < codes.getNumRows(); i++) {
    codes.setRow(i);
                 System.out.println(codes.getString("COMP_CODE") + '\t' +
                                         codes.getString("COMP_NAME"));
            catch (Exception ex) {
               ex.printStackTrace();
               System.exit(1);
            try {
               codes.firstRow();
               for (int i = 0; i < codes.getNumRows(); i++, codes.nextRow()) {
                 function = this.createFunction("BAPI_COMPANYCODE_GETDETAIL");
                 if (function == null) {
                    System.out.println("BAPI_COMPANYCODE_GETDETAIL" +
                                            " not found in SAP.");
                    System.exit(1);
                 function.getImportParameterList().
                    setValue(codes.getString("COMP_CODE"), "COMPANYCODEID");
                 mConnection.execute(function);
                 JCO.Structure returnStructure =
                    function.getExportParameterList().getStructure("RETURN");
                 if (! (returnStructure.getString("TYPE").equals("") ||
                          returnStructure.getString("TYPE").equals("S") ||
                          returnStructure.getString("TYPE").equals("W")) ) {
                    System.out.println(returnStructure.getString("MESSAGE"));
                 JCO.Structure detail =
                    function.getExportParameterList().
                    getStructure("COMPANYCODE_DETAIL");
                 System.out.println(detail.getString("COMP_CODE") + '\t' +
                                         detail.getString("COUNTRY") + '\t' +
                                         detail.getString("CITY"));
           catch (Exception ex) {
              ex.printStackTrace();
              System.exit(1);
           mConnection.disconnect();
         public JCO.Function createFunction(String name) throws Exception {
           try {
              IFunctionTemplate ft =
                mRepository.getFunctionTemplate(name.toUpperCase());
              if (ft == null)
                return null;
              return ft.getFunction();
          catch (Exception ex) {
            throw new Exception("Problem retrieving JCO.Function object.");
       public static void main (String args[]) {
          Bapi2 app = new Bapi2();
    This is the error i'm getting...
    com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed
    Connect_PM  GWHOST=<abc11.aa.abc23.company.com>, GWSERV=sapgw00, ASHOST=<abc11.aa.abc23.company.com>, SYSNR=00
    LOCATION    CPIC (TCP/IP) on local host
    ERROR       hostname '<abc11.aa.abc23.company.com>' unknown
    TIME        Mon Jun 06 17:15:12 2005
    RELEASE     640
    COMPONENT   NI (network interface)
    VERSION     37
    RC          -2
    MODULE      ninti.c
    LINE        332
    DETAIL      NiPGetHostByName2: hostname
                '<abc11.aa.abc23.company.com>' not
         at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
         at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:1098)
         at com.sap.mw.jco.JCO$Client.connect(JCO.java:2983)
         at MyProject.Bapi2.<init>(Bapi2.java:45)
         at MyProject.Bapi2.main(Bapi2.java:233)
    Thx
    PRadeep

  • Problems while starting the Managed Server through Node Manager..

    When I was trying to start a Managed Server using the Nodemanager , I am getting the following error :
    NodeManager not configured to receive commands from host : emis-develop
    I have the "nodemanager.hosts" file under the directory "c:\bea\wlserver6.1\config" and even while invoking the script for the startnodemanager , I am indicating this in the script ! Any ideas for this problem ??

    The system is vulnerable to security attacks, since it trusts certificates signed by the demo trusted CA.> You may configure custom Identity and Trust in weblogic. It is not recommended to use Demo Trsut and Demo Identity for environments higher to Dev. -
    http://download.oracle.com/docs/cd/E14571_01/web.1111/e13707/identity_trust.htm#i1202182
    Regards,
    Anuj

  • Problem while querying from jsp

    I have a query like this ...
    Select name,description,start_date from Events where TO_CHAR(start_date,'MM/DD/YYYY')='09/19/2004';
    I want to execute the same query using java for which i say
    String QQQ="Select name,description,start_date from Events where TO_CHAR(start_date,'MM/DD/YYYY')='?/?/?'"
    PreparedStatement stmt = conn.prepareStatement(QQQ);
    stmt.setString(1,"09");
    stmt.setString(2,"27");
    stmt.setString(3,"2004");
    But I am not getting the results. Is there anything wrong with the Qusetion marks(?) in the query ?
    I get the results if i directly enter the value for the question mark.
    Please help.
    Thanks.

    You would either need to explicitly concatenate the bind variables, i.e.
    String QQQ="Select name,description,start_date from Events where TO_CHAR(start_date,'MM/DD/YYYY')=? || '/' || ? || '/' || ?"or you would need to have a single bind variable and pass the whole string
    String QQQ="Select name,description,start_date from Events where TO_CHAR(start_date,'MM/DD/YYYY')=?"
    stmt.setString(1, "09/27/2004" );Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Problem while doing the Cheque print through f-58

    Dear Team,
    I am encountering an issue while doing the Transaction through F-58 System is generating the cheeque print with coma instead of decimals i.e instead of 1,00,000.00 its comming as 1.000.000,00.
    Please advice how to correct this.
    Thanks for the consideration.
    Regards,
    Suma Nalluri.

    Dear Nambi,
    I have checked the settings there evry thing is fine.Still i am facing the same issue. I do not understand may be due to any bug .Please advice.
    Regards,
    Suma.

  • Problem While checkin in NWDI  adding TableSorter.java class in src of DC

    Hi
    I have added TableSorter.java class in Source folder of One Develop Component and implemented the code to sort the table.It is working fine Locally.
        While I am trying to checkin in NWDI it is throwing error messages like
    location: package tests
        private com.sap.tc.webdynpro.tests.utils.TableSorter _tableSorter;
                                              ^
    /usr/sap/GJ0/JC00/j2ee/cluster/server0/temp/CBS/149/.B/21713/t/47794B28F57C19FA453190A8074C0706/gwd/packages/com.sap.tc.webdynpro.tests.utils.TableSorter/TableBasketView.java :1851: cannot resolve symbol
    symbol  : class TableSorter
    location: package tests
        public com.sap.tc.webdynpro.tests.utils.TableSorter getTableSorter() {
                                             ^
    /usr/sap/GJ0/JC00/j2ee/cluster/server0/temp/CBS/149/.B/21713/t/47794B28F57C19FA453190A8074C0706/gwd/packages/com.sap.tc.webdynpro.tests.utils.TableSorter/TableBasketView.java :1859: cannot resolve symbol
    symbol  : class TableSorter
    location: package tests
        public void setTableSorter(com.sap.tc.webdynpro.tests.utils.TableSorter value) {
                                                                 ^
    /usr/sap/GJ0/JC00/j2ee/cluster/server0/temp/CBS/149/.B/21713/t/47794B28F57C19FA453190A8074C0706/gwd/packages/com.sap.tc.webdynpro.tests.utils.TableSorter/TableBasketView.java :1886: cannot resolve symbol
    symbol  : class TableSorter
    location: package tests
              this._tableSorter = (sap.tc.webdynpro.tests.utils.TableSorter)value;
                                                                 ^
    /usr/sap/GJ0/JC00/j2ee/cluster/server0/temp/CBS/149/.B/21713/t/47794B28F57C19FA453190A8074C0706/gwd/packages/sap.tc.webdynpro.tests.utils.TableSorter/TableBasketView.java:262: cannot resolve symbol
    symbol  : class TableSorter
    location: class sap.tc.webdynpro.tests.utils.TableSorter.TableBasketView.java
         wdContext.currentContextElement().setTableSorter((new TableSorter(table, wdThis.wdGetActSortPrice(), null)));
    Please help me.
    Thanks&Regards

    Hi,
    Where exactly did you put your TableSorter.java?
    It should be in src\packages\<your package foleders>\util
    Please also don't forget to add your TableSorter.java in the OpenActivity which you want to check in.
    I suggest there is also another way to do this but I didn't try it:
    Create new Java Project DC
    Put your TableSorter.java there
    Add all necessary DC for build
    Create two public parts (assembly and compilation)
    And use this parts in your WD DC
    Regards
    Pavel

Maybe you are looking for

  • PLEASE READ EVERYTHING. My macbook pro is with virus. What should I do?

         Hello Guys! Thanks for reading this. First, I ask apologize for any mistakes (I'm not a native speaker neither I live in a country that English is the official language).      I've used an anti-virus called "virus barrier express" for some time

  • Ytd,ptd,qtd in dashboard prompt

    Hi how to use ptd,qtd,ytd as dashboard prompt i created netamount ptd,ytd,qtd in rpd my metric is netamount in dashboard if i select ptd then give ptd values selct ytd give ytd netamount qtd also same its in dashboard change all the reports in dashbo

  • How to get RAM Preview in PP CS5?

    Hello, I'm recently trying out premiere, and the biggest thing that is bothering me right now is that I can't find the RAM preview. I don't have the required graphics card to get the Mercury Playback Engine, but I would at least expect to be able to

  • Server/Data Push Form Java to Flex.

    Hi All ,    In my application ( Flex3 + Java Struts) i am using RPC (HttpService) calls only . Recently i read the article about   DATA PUSH FROM JAVA TO FLEX WITHOUT PAGE REFRESHING USING SERVER PUSH. Can anybody tell me more about this , how to use

  • Image not showing on task flows in ADF Library

    I have a application which uses carousel showing images from blob column. I am using imageservet to show images in carousel component. I deployed this app as ADF Library jar and reference that task flow in other application as region. All components