SQL Standard Tag Library. Help.

i am newbies. and i try to use the STL in a Report page. below is the code in my JSP Page.
<%@ page language = "java" contentType = "text/html" %>
<%@ taglib prefix = "sql" uri="http://java.sun.com/jstl/sql" %>
<%@ taglib prefix = "c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix = "x" uri="http://java.sun.com/jstl/xml" %>
<html>
<body>
<h1><CENTER>Alarm Text Report Testing</CENTER></h1>
<sql:setDataSource var="oracleSource"
driver="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@RioDev:1521:transco"
user="kim"
password="kim"/>
<sql:query var="result" dataSource = "${oracleSource}">
SELECT * FROM kim.ALARM
</sql:query>
<table>
<c:forEach items="${result.rows}" var="${Alarm}" >
<tr>
<td>1</td>
<td><c:out value="${Alarm.ALARM_TEXT}"/></td>
<td><c:out value="${Alarm.AREA}"/></td>
<td><c:out value="${Alarm.GROUP}"/></td>
<td><c:out value="${Alarm[Group]}"/></td>
</tr>
</c:forEach>
</table>
</body>
</html>
and the Output in the explorer:
Alarm Text Report Testing
1
1
1
and the source from the explorer:
<html>
<body>
<h1><CENTER>Alarm Text Report Testing</CENTER></h1>
<table>
<tr>
<td>1</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>1</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>1</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
just wonder why i couldn't get the data from the oracle database.
please help me... thanks alot..
kimseang

Hello, there.
I haven't worked with Oracle database, but I've used taglibs almost the same way with mySQL, so if you are using the correct JDBC driver and Oracle requires no special SQL notation, it looks really strange to me, because you are doing everything correctly.
What I would suggest is to leave data source definition without any variable, i.e. default for the whole JSP page. You can do it this way:
<sql:setDataSource
    driver="oracle.jdbc.OracleDriver"
    url="jdbc:oracle:thin:@RioDev:1521:transco"
    user="kim"
    password="kim"/>In our query you don't need datasource variable either
<sql:query var="result">
      SELECT * FROM kim.ALARM
</sql:query>ForEach looping you seem to do correctly. So, if your driver, username and password are correct, you should pick up the data without problems. Certainly if the table has data in it... ;)

Similar Messages

  • 9iAS JSP/Tag Library Help needed

    Info: We have 9iAS 9.0.2.0.0 running on Sun Solaris (Sparc). I have been to Sun class for JSP/Servlets (SL-314) and have an Iterator custom tag that works fine in Tomcat 4.0. I am compiling on a Windows NT machine using Ant and JDK 1.3. I then deploy using Oracle Enterprise Manager (web interface to 9iAS) and use the Deploy WAR option. The only examples I can find that came with 9iAS use JSP 1.1 Taglib code and they work. Am I missing something, or does 9iAS (9.0.2.0.0) not fully support JSP 1.2 / Servlet 2.3, specifically the 1.2 tag library API?
    Any help would be appreciated...
    Code Snippets from failing JSP:
    <%@ taglib uri="hr/taglib" prefix="hr" %>
    <hr:iterator id="empdata" listName="employeeList">
    <li><jsp:getProperty name="empdata" property="name"/> (<jsp:getProperty name="empdata" property="depth"/>)</li>
    </hr:iterator>
    This generates the following 500 Internal Server error:
    java.lang.NullPointerException
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:279)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:292)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:292)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at oracle.jsp.parse.JspUtils.loadClassJDK(JspUtils.java:219)
         at oracle.jsp.parse.JspUtils.loadClass(JspUtils.java:209)
         at oracle.jsp.parse.JspRTTag.(JspRTTag.java:102)
         at oracle.jsp.parse.JspParseState.createTagParser(JspParseState.java:410)
         at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:538)
         at oracle.jsp.parse.JspParseTagFile.parse(JspParseTagFile.java:160)
         at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:40)
         at oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:295)
         at oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:171)
         at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:338)
         at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:481)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:255)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:59)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:523)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:151)
         at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)

    Sorry techie_sudhanshu .. i was away for the month with no internet access and just got back... here's an example :
    <display:table name="CUSTOMERS"  pagesize="10" id="customer" sort="list" defaultsort="3" requestURI="/customer.do?submit=Search" class="model">
         <display:setProperty name="paging.banner.placement" value="both"/>
         <display:setProperty name="paging.banner.some_items_found" value=""/>
         <display:setProperty name="paging.banner.one_item_found" value=""/>
         <display:setProperty name="paging.banner.all_items_found" value=""/>
         <display:setProperty name="paging.banner.no_items_found" value=""/>
         <display:setProperty name="paging.banner.onepage" value=""/>
         <display:setProperty name="basic.msg.empty_list"><center>No Record(s) was found.</center></display:setProperty>
          <display:column title="Name" sortable="false"><c:out value="${customer.name}"/></display:column>
          <display:column title="Address" sortable="false"><c:out value="${customer.address}"/></display:column>
    </display:table>The line where `<display:setProperty name="paging.banner.placement" value="both"/>` was specify solves your problem. By setting it to BOTH it will appear above and bottom of the paging table.

  • Standard Tag library

    Hi All
    Could anybody let me know what are all standard tag libraries is
    being used for JSP Development in Jdeveloper 3.2.3 environment
    apart from the default one.
    I founnd couple of them on internet, but its difficult to decide
    which one to use. Can some body provide me the url's where I can
    download the trial versions of them
    Thanks!
    Arvind

    Try the Apache Jkarta project tag libraries. They're free and
    quite extensive. Kudos to Apache for all the fine work this
    group does.

  • Tag Library Help

    Hello,
    I have just started to learn about Tag libraries and it's not been the most pleasant experience. Anyways, I did manage to figure out most of the basics of Tag Libraries, but am still unable to understand the use of script variables. I saw an example in the tutorial by Sun, where they used a bean called "book" and I came up with a similar example myself. But in my TEI class the value for type coomes up as null and i had defined a type in my jsp page with my bean tag. Also, all the attributes that come up in my TEI class are my attributes and not my script variables. Is there something wrong in what i am doing?
    I am using tomcat 4.1.10 as my server. and JSP 1.2.
    This is my JSP page now.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <%@page import="com.petris.data.User" %>
    <HTML>
    <HEAD>
    <TITLE> This is a sample page to test the Hello World Tag Library </TITLE>
    <%@ taglib uri="HelloWorld.tld" prefix="hello" %>
    </HEAD>
    <BODY>
    <hello:sayHello userName="Dummy User" age="27">
    <% String dummy; %>
    </hello:sayHello>
    <i><jsp:getProperty name="user" property="name" /></i>
    <br>
    The user age is <jsp:getProperty name="user" property="age" />
    </BODY>
    </HTML>
    And this is my TEI class
    package com.petris.tags;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import java.io.*;
    import java.util.Enumeration;
    public class HelloWorldTEI extends TagExtraInfo
         public VariableInfo[] getVariableInfo(TagData data)
              Enumeration listOfAttributes = data.getAttributes();
              StringBuffer listOfTags = new StringBuffer();
              for(int i = 0; listOfAttributes.hasMoreElements(); i++)
                   Object currentObject = listOfAttributes.nextElement();
                   listOfTags.append(currentObject.toString() + ",");
                   System.out.println(currentObject.toString());
              String type = data.getAttributeString("type");
              System.out.println("*********************");
              System.out.println("TYPE = " + type);
              System.out.println("*********************");
              if (null == type)
                   type = "java.lang.Object";
              return new VariableInfo[]
                   new VariableInfo("user",
                                       "User",
                                       true,
                                       VariableInfo.AT_BEGIN)

    i think i have it figured out. If we want to use the TagExtraInfo class, then we must supply the values to the tag using attributes. Values such as id and type must also be supplied as attributes. Which automatically means that we must supply the bean type getters and setters for these attributes as well. Well this is how i have been able to get it to work. If there is some other way (other than using the variable tag in the TLD), please do let me know. Thought i would post this for others as a future reference.

  • I can't connect to MySQL database from The JSP Standard Tag Library

    Hi All !
    I have a problem, please help me anybody !
    I don't connect to MySQL database from jsp page using JSTL tag but from servlet all work correctly. I set my path and put �mysql-connector-java-3.1.13-bin.jar� in ENVIRONMENT WinXP(classpath=C:\Java\jdk1.5.0_10\jre\lib\ext\mysql-connector-java-3.1.13-bin.jar) and in War project folder �WEB-INF/lib� and in [TomcatServer]\common\lib.
    I have in folder�WEB-INF/lib� following files:
    antlr.jar
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-fileupload.jar
    commons-logging.jar
    commons-validator.jar
    jakarta-oro.jar
    jsf-api.jar
    jsf-impl.jar
    jstl.jar
    mysql-connector-java-3.1.13-bin.jar
    standard.jar
    struts.jar
    I'm using:
    NetBeans 5.5 Build200610171010 (bundled Tomcat 5.5.17)
    Ent.Pack 20061020 Visual Wb Pack 061103
    OS WinXP SP2
    Java 1.5.0_10
    MySQL 5.0.18-nt
    1:<%@page contentType="text/html"%>
    2:<%@page pageEncoding="UTF-8"%>
    8: <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    9: <%@taglib uri="http://java.sun.com/jstl/sql" prefix="sql"%>
    10:
    11: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    12: "http://www.w3.org/TR/html4/loose.dtd">
    13:
    14: <sql:setDataSource var="ds"
    15: driver="com.mysql.jdbc.Driver"
    16: url="jdbc:mysql://localhost:3306/test"
    17: user="root"
    18: password="xxxx"/>
    19:
    20:
    21:<sql:query sql="select name, age from People" var="res"
    22: dataSource="${ds}"/>
    I have received report on mistake when entered code at the top:
    �/index.jsp [21;0] According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions�
    I used instead of (dataSource="${ds}")->(dataSource="ds") but this did not work.
    After build and run I have received
    =========================================START=================================
    HTTP Status 500
    type Exception report:
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: /index.jsp(21,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    org.apache.jasper.JasperException: /index.jsp(21,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
    org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:955)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:710)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
    org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
    org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
    org.apache.jasper.compiler.Validator.validate(Validator.java:1489)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:166)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
    Apache Tomcat/5.5.17
    =======================================END================================
    Error: "According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions" - but according to documentation such parameter possible.
    BUT WHEN JOINING With DATABASE FROM SERVLET ALL WORK FINE.
    I read this doc - [http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html], this applicable if I Tomcat Admin, but i'am not Admin
    I simply user, i.e. I want to place its database on virtual host (Tomcat+(JSP-JSTL)+MySQL).
    There is idea how can resolve this problem
    Thank you in advance ;)

    For all how have similar problem.
    Decision instead of these ways
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    it is necessary to indicate these
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

  • Standard Tags

    I am trying to find out the Que position of a person in waiting Q. These are the steps I am following:
    1. getting the record set
    <sql:query var="myRecordset" dataSource="$myDataBase " >
    SELECT myName FROM WaitingList
    ORDER BY registerationDate
    </sql:query>
    2. Iterating through record set
    <c:forEach var="row" items="$myRecordset.rows">
    <c:if test="$row.get('myName') == '$varName'">
    .... I want to display the row number
    </c:if>
    </c:forEach>
    Now the problem is:
    1. I want to declare varName at run time. I am not able to do so my using the standard JSP methods like <%= .. %>. How is it done in tags. Please help me.
    2. How do you find the row number? I went through the tag documentation, but I could locate any method.
    Please Help me

    <c:if test="$row.get('myName') == '$varName'">
    1. I want to declare varName at run time. varName already is a runtime variable, but setting it directly is probably what's throwing you.
    I've run into the same problem. The standard tag library generates some really obscure Java.
    You can set the value with <c:set var="varName" value="whatever" />, but then how you you set the
    value of value?
    Until we figure out the right way, one workaround is to use scriptlets for the conditionals:
    String myVarName = whateverIWantItToBe;
    String myMyName = <c:out value="${row.myName}" />;
    <% if (myMyName == myVarName) { %>
    [ conditional code here ]
    <% } %>
    2. How do you find the row number? <c:out value="${thisRow.count}"/>

  • Tag Library Compile Warning

    Why does the weblogic jsp compiler wine about this standard tag library
              descriptor DTD?
              <?xml version="1.0" encoding="ISO-8859-1" ?>
              <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library
              1.1//EN"
              "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
              Have yet to see a TLD that does not use precisely this string and yet
              weblogic whines constantly about it.
              

    I figured it out. Under the Configuration/TagLibraries,
    create a CrossTagAttr folder and stick a .vtm file in it. In the
    .vtm file, use the <crosstag_attributes> tag and its
    children. See Configuration/TagLibraries/CrossTagAttr/Spry/Spry.vtm
    for an example.

  • SQL in JSP - do I use JAVA code in % ... % or SQL Tag Library ??

    I have a small web app that makes needs to make about 12 SQL queries in a JSP and am trying to figure out what is the best way to do this
    I had initially coded this using plain JAVA code in the JSP as follows :-
    <%
    Connection conn = null;
    Statement st = null;
    ResultSet rs = null;
    try {
    st = conn.createStatement();
    rs = st.executeQuery("select .........");
    %>
    But then I came across the SQL Tag Library in an article and wonder if this is more efficient code?
    If so does anyone have a pointer to a good intro to these tags as they look complicated (I only am doing queries on the SQL database, no inserts or updates)

    Sometimes you've gotta do what you've gotta do.
    My rule is "no scriptlets".
    If you MUST access a database from a JSP, the only right way to do it is to use JSTL <sql> tags.
    %

  • Problem with sql;query tag!  Please help ...

    Dear all,
    I have the following SQL statement submitted by a sql;query tag:
    <c:out value='${namestring}'/> // <-- namestring is printed out as ABC-% here.
    <sql:query var="resultset">
    SELECT sales
    FROM SALESTABLE
    WHERE name LIKE <c:out value='${namestring}'/> //<-- appearently namestring is not ABC-% anymore!!!
    </sql:query>
    Everything is fine except the satement "WHERE name LIKE ?". The namestring passed in is supposed to be in the form 'ABC-%'. It indeed prints out as 'ABC-%' before the <sql:query/> tag.
    Appearnetly, when it is passed to the statement "WHERE name LIKE ?", it becomes something else because it returns no data.
    Note that when I hardcode 'ABC-%' to the WHERE statement, however, I do get a lot of data back.
    I also tried to to use <sql:param/> tag to tackle it:
    <sql:query var="resultset">
    SELECT sales
    FROM SALESTABLE
    WHERE name LIKE ?
    <sql:param value='${namestring}' />
    </sql:query>
    But still got no data. Is '%" considered as special characters that needs to be treated in a special way? What else do I need to do in order to pass in 'ABC-%' to the statement???
    By the way, is there a way to print out the generated SQL statement to see how all the variables are evaluated?
    Any help or suggestions will be highly appreciated. Thanks.
    Robert.

    Try to escape the special character '%' using '\%'.

  • Jsf-1_0-pfd-spec.pdf - 9.5 Standard HTML RenderKit Tag Library

    I am somewhat confused by section 9.5 in jsf-1_0-pfd-spec.pdf.
    It ends with
    "Each action included in the Standard HTML RenderKit Tag Library is documented
    in a subsection below, with the following outline for each action:"
    I however seem to miss these subsections.
    Am I interpreting something wrong or is there stuff missing?
    Thanks,
    Peter

    The description of Std HTML Renderkit (8.5 ) as well as the Std HTML tag library will be updated by the next release. In the mean time, please refer to the TLD. Sorry for the confusion if any.
    -Jayashri

  • Need help on Flex JSP tag library

    I am new to Flex and currently developing portlets where I
    need to integrate Flex into JSP pages. According to various
    documents from Adobe and other online discussions, this can be done
    with Flex JSP tag library. It appears that the taglib used to be a
    separate package that you could download but no longer available (I
    was only able to find a few broken links). Instead, the library is
    now part of the LiveCycle DS product according to Adobe. However, I
    have downloaded LiveCycle DS and couldn't find the necessary taglib
    in the package. Your help will be highly appreciated.

    I'm trying to do the same thing you are. Its mentioned that
    the library is part of LifeCycle DS but I couldn't find it in there
    either.
    Here's a site I found where you can download
    FlexModule_j2ee.zip It includes some instructions too.
    http://opensource.adobe.com/wiki/display/flexsdk/Downloads
    Here are some other links which may be helpful.
    http://livedocs.adobe.com/flex/3/html/help.html?content=apache_2.html
    http://labs.adobe.com/wiki/index.php/LiveCycle_Data_Services:Setting_up_an_SDK,_Compilers, _and_Flex_Builder
    http://download.macromedia.com/pub/labs/flex_mod_apache/flex_mod_apache.pdf

  • Help with Pager Tag Library

    I am developing a photo website with the JSP Pager Tag Library (http://jsptags.com/tags/navigation/pager/index.jsp). I have installed it and am using it successfully.
    I have one question.
    I have a page called view_fotos.jsp. This page has the pager tag to display the photos in a series of pages. view_fotos.jsp can accept a variety of parameters.
    For example:
    view_fotos.jsp?groupnum=10
    view_fotos.jsp?groupnum=10&user=john
    view_fotos.jsp?user=john&mode=view
    Now, I would like to add the QueryString to all the indexed page links.
    i.e. The page links should become...
    view_fotos.jsp?groupnum=10&pager.offset=0
    view_fotos.jsp?groupnum=10&pager.offset=6
    view_fotos.jsp?groupnum=10&pager.offset=12
    or
    view_fotos.jsp?groupnum=10&user=john&pager.offset=0
    view_fotos.jsp?groupnum=10&user=john&pager.offset=6
    view_fotos.jsp?groupnum=10&user=john&pager.offset=12
    depending on the request's QueryString. Can anyone please let me know how can I accomplish that?
    Thanks for your kind help!
    Regards,
    Joe

    Take a look at the docs on the pg:param tag. Those parameters will make it on the end of your URL. You might also have to export the offset variable in the pg:pager tag so that you can use it later with <%=offset%> but I think if you set the max items per page part of pg:pager to 6, it will do the offset stuff for you. The docs for the pager tag library should have more info though. That's found at http://jsptags.com/tags/navigation/pager/index.jsp along with the download.

  • Connection Pooling and JSP Custom Tag Library - is code (inside) the best way/correc?

    Hi, can anyone advise as to whether my tag library code (based
    on Apache Jakarta Project) will actually achieve connection
    pooling functionality across my entire JSP based application? I
    am slightly concerned that my OracleConnectionCacheImpl object
    may exist multiple times, hence rendering my conection pooling
    attempt useless.
    package com.solved.tag.dbtags.connection;
    import java.io.IOException;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.jsp.tagext.TagSupport;
    import javax.servlet.jsp.JspTagException;
    import javax.sql.DataSource;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import oracle.jdbc.pool.OracleConnectionCacheImpl;
    * <p>JSP tag connection, used to get a
    * java.sql.Connection object.</p>
    * <p>JSP Tag Lib Descriptor
    * <pre>
    * &lt;name>connection&lt;/name>
    &lt;tagclass>com.solved.tag.dbtags.connection.ConnectionTag&lt;/t
    agclass>
    * &lt;bodycontent>JSP&lt;/bodycontent>
    &lt;teiclass>com.solved.tag.dbtags.connection.ConnectionTEI&lt;/t
    eiclass>
    * &lt;info>Opens a connection based on a jndiName.&lt;/info>
    * &lt;attribute>
    * &lt;name>id&lt;/name>
    * &lt;required>true&lt;/required>
    * &lt;rtexprvalue>false&lt;/rtexprvalue>
    * &lt;/attribute>
    * </pre>
    * @author Matt Shannon
    public class ConnectionTag extends TagSupport {
    static private OracleConnectionCacheImpl cache = null;
    public int doStartTag() throws JspTagException {
    try {
    Connection conn = null;
    if (cache == null) {
    try {
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup
    ("jdbc/pool/OracleCache");
    cache = (OracleConnectionCacheImpl)ds;
    catch (NamingException ne) {
    throw new JspTagException(ne.toString());
    conn = cache.getConnection();
    pageContext.setAttribute(getId(),conn);
    catch (SQLException e) {
    throw new JspTagException(e.toString());
    return EVAL_BODY_INCLUDE;
    package com.solved.tag.dbtags.connection;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.jsp.tagext.TagSupport;
    * <p>JSP tag closeconnection, used to close the
    * specified java.sql.Connection.<p>
    * <p>JSP Tag Lib Descriptor
    * <pre>
    * &lt;name>closeConnection&lt;/name>
    &lt;tagclass>com.solved.tag.dbtags.connection.CloseConnectionTag&
    lt;/tagclass>
    * &lt;bodycontent>empty&lt;/bodycontent>
    * &lt;info>Close the specified connection. The "conn"
    attribute is the name of a
    * connection object in the page context.&lt;/info>
    * &lt;attribute>
    * &lt;name>conn&lt;/name>
    * &lt;required>true&lt;/required>
    * &lt;rtexprvalue>false&lt;/rtexprvalue>
    * &lt;/attribute>
    * </pre>
    * @author Matt Shannon
    * @see ConnectionTag
    public class CloseConnectionTag extends TagSupport {
    private String _connId = null;
    * The "conn" attribute is the name of a
    * page context object containing a
    * java.sql.Connection.
    * @param connectionId
    * attribute name of the java.sql.Connection to
    close.
    * @see ConnectionTag
    public void setConn(String connectionId) {
    _connId = connectionId;
    public int doStartTag() {
    try {
    Connection conn = (Connection)pageContext.getAttribute
    (_connId);
    conn.close();
    } catch (SQLException e) {
    // failing to close a connection is not fatal
    e.printStackTrace();
    return EVAL_BODY_INCLUDE;
    public void release() {
    _connId = null;
    package com.solved.tag.dbtags.connection;
    import javax.servlet.jsp.tagext.TagData;
    import javax.servlet.jsp.tagext.TagExtraInfo;
    import javax.servlet.jsp.tagext.VariableInfo;
    * TagExtraInfo for the connection tag. This
    * TagExtraInfo specifies that the ConnectionTag
    * assigns a java.sql.Connection object to the
    * "id" attribute at the end tag.
    * @author Matt Shannon
    * @see ConnectionTag
    public class ConnectionTEI extends TagExtraInfo {
    public final VariableInfo[] getVariableInfo(TagData data)
    return new VariableInfo[]
    new VariableInfo(
    data.getAttributeString("id"),
    "java.sql.Connection",
    true,
    VariableInfo.AT_END
    data-sources.xml:
    <?xml version="1.0"?>
    <!DOCTYPE data-sources PUBLIC "Orion data-
    sources" "http://xmlns.oracle.com/ias/dtds/data-sources.dtd">
    <data-sources>
    <data-source
    class="oracle.jdbc.pool.OracleConnectionCacheImpl"
    name="jdbc/pool/OracleCache"
    location="jdbc/pool/OracleCache"
    url="jdbc:oracle:thin:@oracle1:1521:pdev"
    >
    <property name="maxLimit" value="15" />
    <property name="cacheScheme" value="2" />
    <property name="user" value="console" />
    <property name="password" value="console" />
    <description>
    This DataSource is using an Oracle-native DataSource Class so as
    to allow Oracle Specific extensions.
    A getConnection() call on this DataSource will return
    oracle.jdbc.driver.OracleConnection.
    The connection returned is a logical connection.
    The caching scheme in place is Fixed Wait. Refer below to
    possible values.
    Dynamic 1
    Fixed Wait 2
    Fixed Return Null 3
    </description>
    </data-source>
    </data-sources>
    many thanks,
    Matt.

    Hi. Show me your pool definition.
    Joe
    Ramamurthy wrote:
    I am using the jsp custom tag library from BEA called sqltags.tld which came with Weblogic 5.1. Currently I am using Weblogic6.1 sp2 on Solaris.
    I have created a Connection Pool for Sybase database using the driver com.sybase.jdbc.SybDriver.
    When I created jsp page to connect to the connection pool using sqltags custom tag library, I am getting the error
    "javax.servlet.jsp.JspException: Failed to write body content
    at weblogic.taglib.sql.ConnectionTag.doAfterBody(ConnectionTag.java:43)
    at jsp_servlet.__hubwcdata._jspService(__sampletest.java:1014)"
    After this message, whenever I try to access the same jsp page I am getting the message
    "javax.servlet.jsp.JspException: Failed to load JDBC driver: weblogic.jdbc.pool.D
    river
    at weblogic.taglib.sql.ConnectionTag.doStartTag(ConnectionTag.java:34)
    at jsp_servlet.__hubwcdata._jspService(__sampletest.java:205)".
    Can you please help me the reason why this problem is happening and how to fix this ?
    This problem doexn't happen consistently. This occurs once in a while.
    I tried to increase Login delay Seconds parameter in the Connection Pool to 15 sec. It didn't help me much.
    Thanks for your help !!!
    Ram

  • Announce: JSTL (Standard Tags) + Struts (MVC) live web Demo (open source)

    If you are starting a Java Web, you should use MVC and Standard tags,
              this "kit" is a sample of "best" (at least good) practices.
              It is MVC (Struts/Tiles)+JSTL XSLT DAO (Open Source Data Access Object
              w/ SQL) + DB CRUD (Create update delete and SQL DLL scripts)+ J2EE
              Security ( to make Tomcat run like Apache )
              It is KISS (you'll see how simple and how very standard) , good
              practices Free Open Source Framework to develop any web app, with the
              aim of being 80% of any app, but done as simple as possible and easy to
              teach. Again, everything is standard and simple. And it is the fastest,
              most efficient way to develop maintainable code I know of.
              Samples include CMS (Authorize content, XSLT, CMS Comments, sinkable,
              single sign on, etc.), Issue tracking, + more coming.
              Please download and install and see if you want to attend. Details:
              http://basicportal.sourceforge.net
              I use it to teach Struts + JSTL public and private classes. I epically
              teach WHY you should want to do something in a certain way, not just how.
              To attend and see "best practices"
              http://www.basebeans.com/webEx.jsp
              The seminar requires you know servlets, jsp, SQL, JDBC, and at least
              some MVC. (a plus is if you have already deployed and MVC web app in the
              past) Oh...it is $10.00 ( but free to baseBeans clients and/or apache.org
              committers.)
              To keep in touch on this join "MVC-Programmers" mail list at
              http://www.netbean.net/mailman/listinfo/mvc-programmers
              To keep in touch with open source projects go to
              http://news.netbean.net/cgi-bin/webnews.cgi
              Future plans include more docs, Dream weaver support, mail client, RSS
              feeds, BLOG, Shopping Cart Store, etc. etc.
              Did I say everything is standard and as simple as possible?
              Vic
              "Always code to the least amount of astonishment"
              Elements of Java Style
              

    Hi Devlin.
    > And changing the TLD is not
    > something I think should be done. 
    -> http://help.sap.com/saphelp_nw04/helpdata/en/e7/1f1e405d21c442e10000000a1550b0/frameset.htm
    > I see the portal-inf/lib  Is this the
    > same as web-inf/lib and gets picked up by the
    > webserver?
    -> yes. http://help.sap.com/saphelp_nw04/helpdata/en/f9/561140d72dc442e10000000a1550b0/frameset.htm
    Regards, Karsten

  • Struts tag library instead of JSTL

    My developers here are not very well versed with JSTL .
    Is it advisable to use the Struts tag library instead of JSTL.

    For JSTL you need two jar files in your web-inf/lib directory.
    standard.jar
    jstl.jar
    You only mentioned standard.jar - make sure the other is there as well.
    There are also some libraries requried. I think they were included with JDK1.4, but am not entirely certain.
    Check out the requirements on this page:
    http://jakarta.apache.org/taglibs/doc/standard-1.0-doc/standard-1.0/GettingStarted.html
    Particularly those related to JAXP.
    I am think EOFException might be a trouble with parsing the c.tld file in the standard.jar
    Hope this helps,
    evnafets

Maybe you are looking for

  • FCS doesn't remember my Keyboard Layout

    Hello everyone ! I'm living in France, I have a french keyboard, however my system is in English and all my applications are in English. I've taken out from the package the keyboard layout for french keyboard in FCP. I put it in my FCP User Settings.

  • Ibook powers on for a sec then shuts back down help

    my ibook all of a sudden stopped powering up. but if i leave it alone for like 3 hrs or so it will start to power on get to the gray sscreen then cut back off. i have searched the board but i can still not find a clue as to what is going on or how to

  • Using personal hotspot

    My iPad is Wi-Fi only. I tried tethering it to my iPhone 4S while driving, and it only stayed connected for a short time. Then the "iPhone" network stopped appearing in the "Available Networks".  It seems to work OK when the iPhone and iPad are stati

  • Picking up wrong segment value during FICA document Posting

    Hi, When we are posting any FICA-document manually(FPE1) the segment is getting drived corrcectly for the line items, but issue is happening when the document is getting posted during Invoicing. Everytime it fetchs a default value for segment irrespe

  • Tomcat Error prevents webaccess

    Been reading for 3 days now trying various solutions and still no luck. Server is Netware 6.5 SP8 running all mail functions. Everything is fine with the exception of users not being able to access email via WebAccess. From reading elsewhere this err