Database query in toplink

hi all,
I need to fetch single row from table and have to print it on JSF page in outputText and inputputText boxes....
what should be the procedure???
how to write the query?
and the resultset that is retrieved is in the form of vector how to put their values in outputText boxes?

Hello,
Your questions are pretty broad, but let me address the TopLink aspects of your questions. Once you have an object retrieved via TopLink, then you can consider your JSF presentation of the data that is housed within the object.
Lets say you have a java class named X, and you want instances of X persisted to a table that is also named X. Now you are interested in using TopLink to hydrate an instance of X so that you can render some information for that instance, which contains of course data from table X.
In general, you TopLink map X.class to the table named X with all of the columns in the table mapped to instance attributes defined on X.java or one of its superclasses.
Now the question is how to locate the row of interest from table X? Since you are interested in only one row, it is most likely that you are interested in identifying that row of interest by its primary key, which is likely some numeric surrogate key.
Lets assume you are interested in retrieval by primary key. Lets also assume that the X_ID column on the X table is its primary key. Lets also assume the id instance attribute on X.java (or from one of its superclasses) is TopLink mapped and is simply a direct to field mapping, so the id instance attribute on X.java would take on the value housed in X.X_ID. Lets further assume you want to find the instance of X where X_ID = 123.
The resultset that is retrieved via TopLink does not have to be a Vector (List) of objects. You can express to TopLink that you are only interested in retrieving one object by use of oracle.toplink.queryframework.ReadObjectQuery or oracle.toplink.sessions.Session.readObject().
If you choose the Session.readObject() approach, here is how you obtain the reference to the instance of X that represents the row where X.X_ID = 123:
obtain reference to Session via SessionManager.getManager().getSession(sessionName);
ExpressionBuilder builder = new ExpressionBuilder();
Expression selectionCriteria = builder.get("id").equal(123);
X foundInstance = (X) session.readObject(X.class,selectionCriteria);
If you choose the ReadObjectQuery approach, here is how you obtain the reference:
ReadObjectQuery query = new ReadObjectQuery();
query.setReferenceClass(X.class);
query.setSelectionCriteria(selectionCriteria); // defined above
X foundInstance = (X) session.executeQuery(query);
Once you have a handle to the X instance of interest, you can then go about rendering information about it to an end user via a JSP or JSF JSP page. Typically the queries that I show above are written as part of the implementation of an operation on a Session EJB, but it can be done without a Session EJB as well.
I suggest you take a look at the TopLink Developer's Guide : http://download-west.oracle.com/docs/cd/B31017_01/web.1013/b28218/toc.htm as well as the TopLink API Reference from Javadoc : http://download-west.oracle.com/docs/cd/B31017_01/web.1013/b28219/index.html. Both of these documents are for TopLink 10.1.3.1, but you probably want to find the documentation for the version of TopLink you are using just in case.
Hope that helps,
Doug

Similar Messages

  • How to use user defined function in select query using Toplink

    Hi Friends
    I am little bit of new in Toplink stuff... so please help me...
    I have to database functions 1. encrypt and 2. decrypt.
    I want to exceute the following sql query using toplink
    select port, database, user_name, decrypt(encrypt('String which is to be encrypt ','password'),'password') from CONFIGURATION
    can anyone tell me , how to write code in toplink which will give the about sql output.
    thanks .....

    The "Specifying a Custom SQL String in a DatabaseQuery" section in the TopLink Developer's Guide may help... http://download-uk.oracle.com/docs/cd/B32110_01/web.1013/b28218/qrybas.htm#BCFHDHBG

  • Querying the toplink cache under high-load

    We've had some interesting experiences with "querying" the TopLink Cache lately.
    It was recently discovered that our "read a single object" method was incorrectly
    setting query.checkCacheThenDB() for all ReadObjectQueries. This was brought to light
    when we upgraded our production servers from 4 cores to 8. We immediatly started
    experiencing very long response times under load.
    We traced this down to the following stack: (TopLink version 10.1.3.1.0)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00002aab08fd26d8> (a oracle.toplink.internal.helper.ConcurrencyManager)
    at java.lang.Object.wait(Object.java:474)
    at oracle.toplink.internal.helper.ConcurrencyManager.acquireReadLock(ConcurrencyManager.java:179)
    - locked <0x00002aab08fd26d8> (a oracle.toplink.internal.helper.ConcurrencyManager)
    at oracle.toplink.internal.helper.ConcurrencyManager.checkReadLock(ConcurrencyManager.java:167)
    at oracle.toplink.internal.identitymaps.CacheKey.checkReadLock(CacheKey.java:122)
    at oracle.toplink.internal.identitymaps.IdentityMapKeyEnumeration.nextElement(IdentityMapKeyEnumeration.java:31)
    at oracle.toplink.internal.identitymaps.IdentityMapManager.getFromIdentityMap(IdentityMapManager.java:530)
    at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.checkCacheForObject(ExpressionQueryMechanism.java:412)
    at oracle.toplink.queryframework.ReadObjectQuery.checkEarlyReturnImpl(ReadObjectQuery.java:223)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.checkEarlyReturn(ObjectLevelReadQuery.java:504)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:564)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:779)
    at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:388)
    We moved the query back to the default, query.checkByPrimaryKey() and this issue went away.
    The bottleneck seemed to stem from the read lock on the CacheKey from IdenityMapKeyEnumeration
    public Object nextElement() {
    if (this.nextKey == null) {
    throw new NoSuchElementException("IdentityMapKeyEnumeration nextElement");
    // CR#... Must check the read lock to avoid
    // returning half built objects.
    this.nextKey.checkReadLock();
    return this.nextKey;
    We had many threads that were having contention while searching the cache for a particular query.
    From the stack we know that the contention was limited to one class. We've since refactored that code
    not to use a query in that code path.
    Question:
    Armed with this better knowledge of how TopLink queries the cache, we do have a few objects that we
    frequently read by something other than the primary key. A natural key, but not the oid.
    We have some other caching mechanisms in place (JBoss TreeCache) to help eliminate queries to the DB
    for these objects. But the TreeCache also tries to acquire a read lock when accessing the cache.
    Presumably a read lock over the network to the cluster.
    Is there anything that can be done about the read lock on CacheKey when querying the cache in a high load
    situation?

    CheckCacheThenDatabase will check the entire cache for a match using a linear search. This can be efficient if the cache is very large. Typically it is more efficient to access the database if your cache is large and the field you are querying in the database is indexed in the table.
    The cache concurrency was greatly improved in TopLink 11g/EclipseLink, so you may wish to try it out.
    Supporting indexes in the TopLink/EclipseLink cache is something desirable (feel free to log the enhancement request on EclipseLink). You can simulate this to some degree using a named query and a query cache.
    -- James : http://www.eclipselink.org

  • How to find database query

    Hi all,
    how to find physical query from report here m checking like Administrator->manage session--> report-->view log
    +++Administrator:3220000:3220011:----2011/01/03 02:51:43
    -------------------- SQL Request:
    +++Administrator:3220000:3220011:----2011/01/03 02:51:43
    -------------------- General Query Info:
    Repository: Star, Subject Area: AAA, Presentation: AAA
    +++Administrator:3220000:3220011:----2011/01/03 02:51:43
    -------------------- Cache Hit on query:
    Matching Query:     Created by:     Administrator
    +++Administrator:3220000:3220011:----2011/01/03 02:51:43
    -------------------- Query Status: Successful Completion
    +++Administrator:3220000:3220011:----2011/01/03 02:51:43
    -------------------- Physical Query Summary Stats: Number of physical queries 1, Cumulative time 0, DB-connect time 0 (seconds)
    +++Administrator:3220000:3220011:----2011/01/03 02:51:43
    -------------------- Rows returned to Client 6
    +++Administrator:3220000:3220011:----2011/01/03 02:51:43
    -------------------- Logical Query Summary Stats: Elapsed time 0, Response time 0, Compilation time 0 (seconds)
    but here m not able to find database query..how to find that query plz help
    Edited by: Sonal on Jan 3, 2011 5:29 AM
    Edited by: Sonal on Jan 3, 2011 5:30 AM
    Edited by: Sonal on Jan 3, 2011 5:30 AM

    Hi,
    as Daan said, set the variable in Advanced tab but not on loglevel..
    because, our problem is to bypass the bi-server cache.
    Do this:
    1. Go to Advanced tab.
    2. In Prefix field(scroll down to see this field) , enter this:
    SET DISABLE_CACHE_HIT = 1;
    Note: Make sure that you're ended up above statement with semicolon and do not click on Set SQL option...
    3. Save report, then run it..
    4. After you see the query, i recommend you to take take out that prefix tag then save it again..

  • Another Error Executing Database Query.

    I am getting this error.
    12:40:54.054 - Database Exception - in
    C:\CFusionMX7\wwwroot\Author\dropdown2\EmployeeAddAction.cfm : line
    26
    Error Executing Database Query.
    i have added extra fields in the mdb and added extra code to
    the form page and the action page.
    i am getting this error still.
    this is how i broke it down.
    If I run my 2 files EmployeeAddForm.cfm and
    EmployeeAddAction.cfm
    I get this error:
    NOTE: if i take out the comments from the code and ignore the
    new fields added to the db it works fine!!!!!
    The web site you are accessing has experienced an unexpected
    error.
    Please contact the website administrator.
    The following information is meant for the website developer
    for debugging purposes.
    Error Occurred While Processing Request
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in
    INSERT INTO statement.
    Resources:
    Enable Robust Exception Information to provide greater detail
    about the source of errors. In the Administrator, click Debugging
    & Logging > Debugging Settings, and select the Robust
    Exception Information option.
    Check the ColdFusion documentation to verify that you are
    using the correct syntax.
    Search the Knowledge Base to find a solution to your problem.
    Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
    SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
    Remote Address 127.0.0.1
    Referrer
    http://127.0.0.1:8500/Author/dropdown2/EmployeeAddForm.cfm
    Date/Time 06-Jun-07 12:40 PM
    NOTE: if i take out the comments from the code and ignore the
    new fields added to the db it works fine!!!!!

    Try using '###CreateODBCDate(Form.DateOfBirth)###'. Access is
    strange on
    handling dates. It has a been a while since I have used
    Access so it could
    be as simple as wrapping it single quotes as well. I am
    assuming the
    "<!-----------" wasn't intended, but I could be wrong.
    Bryan Ashcraft (remove brain to reply)
    Web Application Developer
    Wright Medical Technology, Inc.
    Macromedia Certified Dreamweaver Developer
    Adobe Community Expert (DW) ::
    http://www.adobe.com/communities/experts/
    "Coldfusionstudent" <[email protected]>
    wrote in message
    news:[email protected]...
    >I am getting this error.
    > 12:40:54.054 - Database Exception - in
    >
    C:\CFusionMX7\wwwroot\Author\dropdown2\EmployeeAddAction.cfm : line
    26
    > Error Executing Database Query.
    >
    > i have added extra fields in the mdb and added extra
    code to the form page
    > and
    > the action page.
    > i am getting this error still.
    > this is how i broke it down.
    >
    > If I run my 2 files EmployeeAddForm.cfm and
    EmployeeAddAction.cfm
    > I get this error:
    >
    > The web site you are accessing has experienced an
    unexpected error.
    > Please contact the website administrator.
    >
    > The following information is meant for the website
    developer for debugging
    > purposes.
    >
    > Error Occurred While Processing Request
    > Error Executing Database Query.
    > [Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][ODBC Microsoft
    > Access Driver] Syntax error in INSERT INTO statement.
    >
    >
    > Resources:
    > Enable Robust Exception Information to provide greater
    detail about the
    > source
    > of errors. In the Administrator, click Debugging &
    Logging > Debugging
    > Settings, and select the Robust Exception Information
    option.
    > Check the ColdFusion documentation to verify that you
    are using the
    > correct
    > syntax.
    > Search the Knowledge Base to find a solution to your
    problem.
    >
    >
    > Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
    5.1; SV1; .NET CLR
    > 1.1.4322; .NET CLR 2.0.50727)
    > Remote Address 127.0.0.1
    > Referrer
    http://127.0.0.1:8500/Author/dropdown2/EmployeeAddForm.cfm
    > Date/Time 06-Jun-07 12:40 PM
    >
    >
    >
    > EmployeeAddForm.cfm
    >
    > <cfquery name="GetCompanies"
    > datasource="#Request.MainDSN#">
    > SELECT
    > CompanyID,
    > CompanyName
    > FROM
    > Company
    > ORDER BY
    > CompanyName
    > </cfquery>
    >
    > <html>
    > <head>
    > <title>ColdFusion MX Bible</title>
    > <link rel="stylesheet" href="styles.css">
    > </head>
    >
    > <body>
    >
    > <h1> </h1>
    >
    > <table>
    > <cfform action="EmployeeAddAction.cfm"
    method="POST">
    >
    > <tr>
    > <td>Company</td>
    > <td>
    > <cfselect name="CompanyID"
    > size="1"
    > query="GetCompanies"
    > value="CompanyID"
    > display="CompanyName"
    > required="Yes"
    > message="Please select a Company."></cfselect>
    > </td>
    > </tr>
    >
    > <tr>
    > <td>SSN</td>
    > <td>
    > <cfinput type="Text"
    > name="SSN"
    > message="Please enter the employee's Social Security
    Number."
    > validate="social_security_number"
    > required="Yes"
    > size="12"
    > maxlength="11">
    > </td>
    > </tr>
    >
    > <tr>
    > <td>First Name</td>
    > <td>
    > <cfinput type="Text"
    > name="Firstname"
    > message="Please enter the employee's first name."
    > required="Yes"
    > size="22"
    > maxlength="20">
    > </td>
    > </tr>
    >
    > <tr>
    > <td>Last Name</td>
    > <td>
    > <cfinput type="Text"
    > name="Lastname"
    > message="Please enter the employee's last name."
    > required="Yes"
    > size="22"
    > maxlength="20">
    > </td>
    > </tr>
    >
    > <tr>
    > <td>Salary</td>
    > <td>
    > <cfinput type="Text"
    > name="Salary"
    > message="Please enter a valid salary."
    > validate="float"
    > required="Yes"
    > size="22"
    > maxlength="20">
    > </td>
    > </tr>
    >
    > <tr>
    > <td>DOB</td>
    > <td>
    > <cfinput type="Text"
    > name="DateOfBirth"
    > message="Please enter a valid date of birth in the
    format mm/dd/yyyy"
    > validate="date"
    > required="Yes"
    > size="11"
    > maxlength="10">
    > </td>
    > </tr><!-------------
    > <tr>
    > <td>device_typ</td>
    > <td>
    > <cfinput type="Text"
    > name="device_typ"
    > message="Please enter the employee's device_typ."
    > required="Yes"
    > size="22"
    > maxlength="20">
    > </td>
    > </tr><tr>
    > <td>device_Email</td>
    > <td>
    > <cfinput type="Text"
    > name="device_Email"
    > message="Please enter the employee's device_Email."
    > required="Yes"
    > size="22"
    > maxlength="20">
    > </td>
    > </tr><tr>
    > <td>Work_email</td>
    > <td>
    > <cfinput type="Text"
    > name="Work_email"
    > message="Please enter the employee's Work_email."
    > required="Yes"
    > size="22"
    > maxlength="20">
    > </td>
    > </tr><tr>
    > <td>Pin_Number</td>
    > <td>
    > <cfinput type="Text"
    > name="Pin_Number"
    > message="Please enter the employee's Pin_Number."
    > required="Yes"
    > size="22"
    > maxlength="20">
    > </td>
    > </tr>------------------>
    > <tr>
    > <td> </td>
    > <td>
    > <input type="submit" value="Add to Database">
    > </td>
    > </tr>
    >
    > </cfform>
    > </table>
    >
    > </body>
    > </html>
    > ---------------------------
    > EmployeeAddAction.cfm
    >
    > <cfquery name="InsertEmployee"
    > datasource="#Request.MainDSN#">
    > INSERT INTO Employee(
    > SSN,
    > CompanyID,
    > Firstname,
    > Lastname,
    > Salary,
    > DateOfBirth<!----------,
    > device_typ,
    > device_Email,
    > Work_email,
    > Pin_Number-------------->
    >
    > )
    > VALUES (
    > '#Trim(Form.SSN)#',
    > #Val(Form.CompanyID)#,
    > '#Trim(Form.Firstname)#',
    > '#Trim(Form.Lastname)#',
    > #Val(Form.Salary)#,
    > #CreateODBCDate(Form.DateOfBirth)#<!-----------,
    > '#Trim(Form.device_typ)#',
    > '#Trim(Form.device_Email)#',
    > '#Trim(Form.Work_email)#',
    > '#Trim(Form.Pin_Number)#'------------------>
    > )
    > </cfquery>
    >
    > <cfmail
    to="#Form.Firstname#.#Form.Lastname#@somewhere.com"
    > from="[email protected]"
    > subject="Welcome to your new company!">
    > Welcome to your new company, #Form.Firstname#
    #Form.Lastname#!
    > </cfmail>
    > <!----
    > <cflocation url="EmployeeList.cfm">----->
    >

  • Generate an xml file from Database query results

    Hi, can anyone help me out with this problem I'm having. What are the steps in creating an xml file directly from the results of a database query. I currently have a very simply process that queries a database via a partner link. The query returns the data but it's from this point that I am stuck. I need to create an xml file with the data along with the xml tags. I've looked at dozens of tutorials with no luck.
    I would greatly appreciate help with this.
    bpel rookie

    Should be quite simple.
    Create another partnerlink, configure it to use the file adapter, and write to an XML file. In this case you need to create an XML Schema (.xsd) of the file you want to create.
    Before you write to the file, either add assign steps to copy individual attributes or use a transform activity to convert from the database format to the file (xml) format.

  • Access database query resultset in java scriptlet

    Question:
    1) I am Creating a web page and plotting points on the page:
    2) Database query results in decimal values dec_latitude and dec_longiitude.
    3) Perform calculations on lati. & long. in a java scriptlet to create a plot position (xpos, ypos).
    4) Send the xpos and ypos back to the java server page
    5) Use <IMG and absolute positioning to plot the point at position xpos, and ypos.
    6) Repeat until all rows in the query result set have been plotted.
    I don't know how to pass the dec_latitude and dec_longitude to the java scriptlet.
    After the java scriptlet calculation translates the latitude and longitude
    into xpos and ypos, I need to pass the xpos and ypos back to the java server page so that a data point is plotted on a map at position xpos, ypos.
    I tried many ways of doing it but am just guessing as
    to how to pass the data.
    Thanks in Advance. - John
    Here is what I am trying so far .... see snippet below:
    The code below results in a runtime error.
    Am I supposed to create a java object and access that in the java scriptlet? Can the java scriptlet access the latvar and longvar created during the "<c:set var="latvar"... ?
    If not, what mechanisum do I use to access the resulting colums: dec_latitude and dec_longitude? I need the java scriptlet to convert the
    dec_latitude and dec_longitude into a display position based on the number of pixels from the TOP and LEFT (xpos, ypos). Then plot of the data point using the IMG and (xpos, ypos). This will overlay a map whose z-index is lower than the plotted data point.
    *** Query the database ***
    <sql:query var="qryBio">
    SELECT
    DEC_LATITUDE,
    DEC_LONGITUDE,
    ENTRY_TIMESTAMP
    FROM app.biosurvey where
    </sql:query>
    *** for each row retreived from the database ***
    <c:forEach var="row" items="${qryBio.rows}">
    <c:set var="latvar" value="${row.dec_latitude}" scope="page"/>
    <c:set var="longvar" value="${row.dec_longitude} "scope="page" />
    *** java code scriptlet - ***
    *** convert latitude and longitude to xpos and ypos for display ***
    <%
    latitude = (Float)pageContext.getAttribute("latvar"); <--- runtime error !!!!
    longitude = (Float)pageContext.getAttribute("longvar");
    xpos = (int)Math.round(latitude);
    ypos = (int)Math.round(longitude);
    xpos = 1082 - xpos;
    ypos = 700 + ypos;
    pageContext.setAttribute("xpos", xpos);
    pageContext.setAttribute("ypos", ypos);
    %>
    *** plot a point on the display html page overlaying the map ***
    <IMG ID="Row" SRC="smallredbox.jpg" ALT="red box"
    STYLE="position:absolute;
    top:<%=xpos%> px;
    left:<%=ypos%> px;
    z-index:2">
    </c:forEach>

    Thanks
    I still get a runtime error: I translated the code you gave to code below .... which I think is equivalent. See Below: I'm still learning about this stuff so I may not have not translated this properly. Do
    you see what I am doing wrong?
    Best Regards,
    - John
    %@ page language="java" contentType="text/html;
    charset=ISO-8859-1"%>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ page import="java.lang.Math"%>
    <sql:setDataSource dataSource="jdbc/SampleDB" />
    <c:set var="genus_name" value="${param.genus_name}" />
    <c:set var="species_name" value="${param.species_name}" />
    <c:set var="species_common_name" value="${param.species_common_name}" />
    <c:set var="dd_sighted" value="${param.dd_sighted}" />
    <c:set var="mm_sighted" value="${param.mm_sighted}" />
    <c:set var="yyyy_sighted" value="${param.yyyy_sighted}" />
    <c:set var="species_state" value="${param.species_state}" />
    <c:set var="species_county" value="${param.species_county}" />
    <c:set var="species_country" value="${param.species_country}" />
    <c:set var="dec_latitude" value="${param.dec_latitude}" />
    <c:set var="dec_longitude" value="${param.dec_longitude}" />
    <c:set var="notes" value="${param.notes}" />
    <c:set var="person_first_name" value="${param.person_first_name}" />
    <c:set var="person_last_name" value="${param.person_last_name}" />
    <c:set var="person_street" value="${param.person_street}" />
    <c:set var="person_city" value="${param.person_city}" />
    <c:set var="person_state" value="${param.person_state}" />
    <c:set var="person_zip" value="${param.person_zip}" />
    <c:set var="person_country" value="${param.person_country}" />
    <c:set var="person_email" value="${param.person_email}" />
    <h2>Species Sightings:</h2>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Breckenridge Citizen Bio-Survey Selective Output Page</title>
    </head>
    <body>
    Izaak Walton League of America
    <h1>Breckenridge Citizen Bio-Survey Selective Output</h1>
    <HR>
    <c:if test="${param.action == 'Submit'}">
    <%int xpos = 0;
         int ypos = 0;
         float latitude = 0.0F;
         float longitude = 0.0F;
         float latitudeMpls = 45.06F;
         float longitudeMpls = -93.14F;                    int xposMpls = 1205 - (int) Math.round(latitudeMpls);
         int yposMpls = 735 + (int) Math.round(longitudeMpls);
    %>
    <IMG SRC="minnesota_1990.jpg" ALT="minesota map" style="z-index:1;"> <----- THIS WORKS FINE
    <IMG ID="Row" SRC="smallredbox.jpg" ALT="red box"
    STYLE="position:absolute;
    top:<%=xposMpls%> px;
    left:<%=yposMpls%> px;
    z-index:2"> <----- THIS WORKS FINE FOR HARDCODED MPLS XPOS AND YPOS
    <sql:query var="qryBio">
    SELECT
    PERSON_FIRST_NAME,
    PERSON_LAST_NAME,
    GENUS_NAME,
    SPECIES_NAME,
    SPECIES_COMMON_NAME,
    SPECIES_COUNTY,
    SPECIES_STATE,
    SPECIES_COUNTRY,
    DD_SIGHTED,
    MM_SIGHTED,
    YYYY_SIGHTED,
    DEC_LATITUDE,
    DEC_LONGITUDE,
    NOTES,
    ENTRY_TIMESTAMP
    FROM app.biosurvey where
    genus_name like rtrim(upper('${genus_name}')) AND
    species_name like rtrim(upper('${species_name}')) AND
    species_common_name like rtrim(upper
    ('${species_common_name}')) AND
    species_state like rtrim(upper('${species_state}')) AND
    species_county like rtrim(upper('${species_county}')) AND
    species_country like rtrim(upper('${species_country}')) AND
    person_first_name like rtrim(upper('${person_first_name}')) AND
    person_last_name like rtrim(upper('${person_last_name}')) AND
    person_email like rtrim(upper('${person_email}'))
    </sql:query>
    <c:forEach var="row" items="${qryBio.rows}">
    <--- THE LINE ABOVE WORKS FINE --->
    <c:set var="latvar" value="${row.dec_latitude}" scope="page" />
    <c:set var="longvar" value="${row.dec_longitude} " scope="page" />
    <%
    latitude =
    Float.parseFloat((String)pageContext.getAttribute("latvar"));
    <--- RUNTIME ERROR OCCURS HERE --- SEE LINE ABOVE --->
    longitude =
    Float.parseFloat((String)pageContext.getAttribute("longvar"));
    xpos = (int) Math.round(latitude);
    ypos = (int) Math.round(longitude);
    xpos = 1082 - xpos;
    ypos = 700 + ypos;
    request.setAttribute("xpos",new Integer(xpos));
    request.setAttribute("ypos",new Integer(ypos));
    %>
    IIMG ID="Row" SRC="smallredbox.jpg" ALT="red box"
    STYLE="position:absolute;
    top:<%=xpos%> px;
    left:<%=ypos%> px;
    z-index:2">
    <--- THIS (ABOVE) WORKS FINE WITH CORRECT VALUES FOR XPOS AND YPOS WHEN RUNTIME ERROR DOES NOT OCCUR --->
    </c:forEach>
    </c:if>

  • Word Wrap database query results

    In Visual Studio 2005, when you are looking at the results of a database query, or table (show table data) etc., how can you make the results field values wrap like we use to be able to do in VS 2003 and in Visual Interdev.
    If the field values were longer then what was display in the grid output results, you could expand the column width and row height and the field values would wrap to fit.  If I try to do the same thing in VS 2005 or in sql enterprise manager 2005 the field values don't wrap, they remain displayed in one long line and they just get cut off after a specific number of characters.

    I'm a Program Manager on the SQL Server Manageability team.  We own SQL Server Management Studio.  Sorry to hear about your frustration with our product.  The team had many tasks to complete in the SQL Server 2005 timeframe and there are some usability improvements that seem simple and were overlooked.  We are committed to improving our customers' experience with our products.
    I would recommend that you go to http://connect.microsoft.com/SQLServer/ and file this issue.  You'll be able to track it throughout its lifecycle.  Once we have a solution for the scenario, we will let you know which release of SQL Server in which you will be able to see your suggestion.
    So, yes, we are listening :)
    Paul A. Mestemaker II
    Program Manager
    Microsoft SQL Server
    http://blogs.msdn.com/sqlrem/

  • Error Executing Database Query (Encountered [nullstring])

    The attached code gives the following error message. I did
    have nullstrings being submitted as the "notes" and "internal
    notes," but I removed them in an (unsuccessful) attempt to solve
    this problem. Can this be fixed? Thanks!
    quote:
    Error Executing Database Query.
    Syntax error: Encountered "" at line 9, column 43.
    The error occurred in
    C:\ColdFusion8\wwwroot\Example\init.cfm: line 6
    4 : </head>
    5 : <body>
    6 : <CFQUERY NAME="init" DATASOURCE="Example">
    7 : CREATE TABLE programs(
    8 : ID int,
    SQLSTATE 42X01
    SQL CREATE TABLE programs( ID int, program_ID int, name
    varchar(20), long_name varchar(50), creator_email varchar(50),
    notes varchar(50), internal_notes varchar(50), is_public bool );
    INSERT INTO programs( ID, program_ID, name, long_name,
    creator_email, is_public ) VALUES( 0, 1, "Basic", "Basic
    (pre-selected)", "[email protected]", true ); SELECT * FROM
    programs;
    VENDORERRORCODE 30000
    DATASOURCE Example
    Resources:
    * Check the ColdFusion documentation to verify that you are
    using the correct syntax.
    * Search the Knowledge Base to find a solution to your
    problem.
    Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
    rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
    Remote Address 127.0.0.1
    Referrer
    Date/Time 20-Feb-08 11:53 PM
    Stack Trace
    at
    cfinit2ecfm949254281.runPage(C:\ColdFusion8\wwwroot\Example\init.cfm:6)
    at
    cfinit2ecfm949254281.runPage(C:\ColdFusion8\wwwroot\Example\init.cfm:6)
    [ginormous Java stacktrace omitted]

    I whittled my SQL down to the first query and added the
    transaction block, but the error remains. Thanks for your time!
    quote:
    Error Executing Database Query.
    Syntax error: Encountered "" at line 9, column 51.
    The error occurred in
    C:\ColdFusion8\wwwroot\Example\init.cfm: line 7
    5 : <body>
    6 : <CFTRANSACTION>
    7 : <CFQUERY NAME="init" DATASOURCE="Example">
    8 : CREATE TABLE programs(
    9 : ID int,
    SQLSTATE 42X01
    SQL CREATE TABLE programs( ID int, program_ID int, name
    varchar(20), long_name varchar(50), creator_email varchar(50),
    notes varchar(50), internal_notes varchar(50), is_public bool );
    VENDORERRORCODE 20000
    DATASOURCE Example
    Resources:
    * Check the ColdFusion documentation to verify that you are
    using the correct syntax.
    * Search the Knowledge Base to find a solution to your
    problem.
    Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
    rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
    Remote Address 127.0.0.1
    Referrer
    Date/Time 22-Feb-08 10:02 AM
    Stack Trace
    at
    cfinit2ecfm949254281.runPage(C:\ColdFusion8\wwwroot\Example\init.cfm:7)
    at
    cfinit2ecfm949254281.runPage(C:\ColdFusion8\wwwroot\Example\init.cfm:7)

  • How to extract the Physical Query(database Query)

    Hi ,
    How to extract the Physical Query(database Query) from obiee which was fired in obiee
    Regards
    Ranga

    Hi Ranganath,
    Have a look the following links.
    Setting Logging level:
    http://gerardnico.com/wiki/dat/obiee/loglevel
    How to see physical query:
    http://gerardnico.com/wiki/dat/obiee/manage_session_log
    If you are new to OBIEE, spend some hours on the following blog to learn from basics to advanced level.
    http://gerardnico.com/wiki/
    http://obiee101.blogspot.com/
    http://www.rittmanmead.com/blog/
    Hope it helps you.
    Regards,
    Kalyan Chukkapalli
    http://123obi.com

  • XPATH Database Query Syntax in an Assign

    Trying to get an XPATH Database query to work by assigning the Input variable value in a simple BPEL Process to my query condition. I keep getting invalid XPATH errors. I cannot seem to figure out how get write it out.
    Here is what I have:
    <from expression="orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')"/>
    Here is my error:
    Error(30): [Error ORABPEL-10039]: invalid xpath expression [Description]: in line 30 of "C:\OraBPELPM_1\integration\jdev\jdev\mywork\BPELws\ReadDB\ReadDB.bpel", xpath expression "orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')" specified in <from> is not valid, because XPath query syntax error. Syntax error while parsing xpath expression "orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')", at position "80" the exception is Expected: ). Please verify the xpath query "orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')" which is defined in BPEL process. . [Potential fix]: Please make sure the expression is valid.
    Any help?
    Thanks!!!

    Ok. I have figured out how to place the condition (variable value) inside a concatentated string. So my final result is the actual XPATH Query-Database statement. But the problem is it is being returned as a String. How can I turn that final string into the XPATH expression I need? I suspect another <COPY> block could pull this off but I am not sure how to do it.
    Here is my code:
    <process name="QueryBuild" targetNamespace="http://xmlns.oracle.com/QueryBuild" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:ns1="http://www.w3.org/2001/XMLSchema" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:client="http://xmlns.oracle.com/QueryBuild" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
    <partnerLinks>
    <partnerLink name="client" partnerLinkType="client:QueryBuild" myRole="QueryBuildProvider"/>
    </partnerLinks>
    <variables>
    <variable name="inputVariable" messageType="client:QueryBuildRequestMessage"/>
    <variable name="outputVariable" messageType="client:QueryBuildResponseMessage"/>
    <variable name="QueryText" type="ns1:string"/>
    </variables>
    <sequence name="main">
    <receive name="receiveInput" partnerLink="client" portType="client:QueryBuild" operation="process" variable="inputVariable" createInstance="yes"/><!-- Generate reply to synchronous request -->
    <assign name="Assign_1">
    <copy>
    <from expression="concat(&quot;orcl:query-database('select ename from emp where empno = &quot;, bpws:getVariableData('inputVariable','payload','/client:QueryBuildProcessRequest/client:input'), &quot;,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL)'&quot;)"/>
    <to variable="QueryText"/>
    </copy>
    <copy>
    <from variable="QueryText"/>
    <to variable="outputVariable" part="payload" query="/client:QueryBuildProcessResponse/client:result"/>
    </copy>
    </assign>
    <reply name="replyOutput" partnerLink="client" portType="client:QueryBuild" operation="process" variable="outputVariable"/>
    </sequence>
    </process>

  • Error Executing Database Query - Help!

    I have a cfquery code that looks like this:
        <CFQUERY DATASOURCE="mydatabase" USERNAME="myuser" PASSWORD="mypassword" NAME="codelist" CACHEDWITHIN="#CreateTimeSpan(0,1,0,0)#">
        SELECT *
        FROM systemcode
        WHERE (LEN(TRIM(systemcode)) = 2 OR LEN(TRIM(systemcode)) = 4)
        <CFSWITCH EXPRESSION="#CAT#">
        <CFCASE VALUE="1">AND (MID(systemcode,1,2) BETWEEN '01' AND '05')</CFCASE>
        <CFCASE VALUE="2">AND (MID(systemcode,1,2) BETWEEN '06' AND '15')</CFCASE>
        <CFCASE VALUE="3">AND (MID(systemcode,1,2) BETWEEN '16' AND '24')</CFCASE>
        <CFCASE VALUE="4">AND (MID(systemcode,1,2) BETWEEN '25' AND '27')</CFCASE>
        <CFCASE VALUE="5">AND (MID(systemcode,1,2) BETWEEN '28' AND '38')</CFCASE>
        <CFCASE VALUE="6">AND (MID(systemcode,1,2) BETWEEN '39' AND '40')</CFCASE>
        <CFCASE VALUE="7">AND (MID(systemcode,1,2) BETWEEN '41' AND '43')</CFCASE>
        <CFCASE VALUE="8">AND (MID(systemcode,1,2) BETWEEN '44' AND '49')</CFCASE>
        <CFCASE VALUE="9">AND (MID(systemcode,1,2) BETWEEN '50' AND '63')</CFCASE>
        <CFCASE VALUE="10">AND (MID(systemcode,1,2) BETWEEN '64' AND '67')</CFCASE>
        <CFCASE VALUE="11">AND (MID(systemcode,1,2) BETWEEN '68' AND '71')</CFCASE>
        <CFCASE VALUE="12">AND (MID(systemcode,1,2) BETWEEN '72' AND '83')</CFCASE>
        <CFCASE VALUE="13">AND (MID(systemcode,1,2) BETWEEN '84' AND '85')</CFCASE>
        <CFCASE VALUE="14">AND (MID(systemcode,1,2) BETWEEN '86' AND '89')</CFCASE>
        <CFCASE VALUE="15">AND (MID(systemcode,1,2) BETWEEN '90' AND '97')</CFCASE>
        <CFCASE VALUE="16">AND (MID(systemcode,1,2) BETWEEN '98' AND '99')</CFCASE>
        <CFDEFAULTCASE><CFLOCATION URL="somewhere.htm"></CFDEFAULTCASE>
        </CFSWITCH>
        ORDER BY systemcode
        </CFQUERY>
    This works perfectly in CF 5.  However, when running in CF 8 I am getting the error message:
    Error Executing Database Query.FUNCTION mydatabase.LEN does not exist The specific sequence of files included or processed is: /home/httpd/vhosts/somedomain.com/httpdocs/reference/systemcode.cfm, line: 24
    (that refers to the above cfquery)
    "mydatabase" is the name of the database and LEN is a function.    It's checking for the length of systemcode to be 2 or 4, if they are then check if the value of #CAT# is 1 and that the first 2 characters is between 01 and 05 then select the row.  I don't know why it works with CF5 but not CF8?  It's driving me nuts.  Any help is appreciated.

    I just don't see why
    all of a sudden it doesn't work with CF8 and MySQL,
    If you changed databases, that is the source of the problem, not upgrading CF.  MySQL will not understand MS Access specific functions and vice versa. Do not expect queries written for one database type to automatically work with another.  While there are sql standards, every database is different. It is quite common for database vendors to have totally different function names, data types and even syntax. You will need to throrougly review your database queries and convert any Access specific syntax, data types, etcetera to the MySQL equivalents.
    Are there MySQL equivalent for these two functions (TRIM and
    LEN)?
    Yes. See the string functions section in the online mySQL docs.
    http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
    I don't konw there was a TRIM and LEN in MS Access
    database.  I guess I was mixing them.
    Yes. It is a little confusing because both CF and MS Access have those functions.  In this specific case you were using the Access functions, not CF.
            http://www.techonthenet.com/access/functions/index_alpha.php
    >> Yes, I did put a
    CFLOCATION inside the cfquery.  Never encounter that
    scenario so I didn't know if it works.
    Well if you are using the code, it should be something you have tested. So you know how it behaves. But CFLOCATION really does not belong inside a database query.
    `

  • Error Executing Database Query

    I have a web application written in CF8 with Oracle 11g as the back end. This application has been used very often for more than 6 years. Currently I am moving to CF10 and did only a little modification to the CF codes. When I ran the new application in my test server, everything seems to be working just fine except when it calls an Oracle Package. This action produces an error:  Error Executing Database Query The strange thing is everything work before and after calling the procedure, I tested using cfabort This Oracle Package is still working in production server (CF8)  but not when it is called by CF10. My question is: Is there any changes for CF10 when calling a procedures? or is there any hotfix that I'm not aware of? The code is as follow:   SELECT case trim(to_char(SYSDATE, 'DAY')) WHEN 'MONDAY' then '1' else '2' end AS TodaysDate                 from dual     
                SELECT Count(other_id) AS NoRecFound     FROM gl_dup_ids_ssns     WHERE Trim(create_date) = 
                SELECT Count(other_id) AS NoRecFound     FROM gl_dup_ids_ssns     WHERE Trim(create_date) =         CF codes to Stop the process and email admin                                                             
                  Error Executing Database Query shows up when it hit to run cfstoredproc. The codes are exactly the same as in CF8, this template was not modified. Exceptions 14:03:53.053 - Database Exception - in /home/space/users/www/GL/glproc.cfm : line 93     Error Executing Database Query. 

    mega_L wrote:
    SELECT case trim(to_char(SYSDATE, 'DAY')) WHEN 'MONDAY' then '1' else '2' end AS TodaysDate                 from dual     
                SELECT Count(other_id) AS NoRecFound     FROM gl_dup_ids_ssns     WHERE Trim(create_date) =
                SELECT Count(other_id) AS NoRecFound     FROM gl_dup_ids_ssns     WHERE Trim(create_date) =         CF codes to Stop the process and email admin                                                            
    Surely, that cannot be the actual SQL, as it is obviously invalid.

  • How to display result of database query in JFrame?

    How to display result of oracle database query in JFrame?
    This is part of my code:
    String username, password;
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
              OracleConnection conn = DriverManager.getConnection(String url, String username, String password);
    Statement s= conn.createStatement();
    ResultSet q= s.executeQuery("SELECT A, B, C FROM TABLE X");
    Forget what url, username & password are. Is there any problem with my code?
    What should be next if I want to display result of the query in a table in JFrame?Thx !

    How to create JTable with unknown no. of rows? How to get no. of rows of a query?
    I saw the demo of creating JTable on java.sun.com but the the table has a certain no. of rows which is not applicable to my case.
    Suppose the result of query is a table with 3 attributes so there are 3 columns in the table.
    R contains the result of the query.
    Should it be something like this if I want to create JTable of the query?
    How to make n rows of {R.getString(1),R.getString(2),R.getString(3)};?
    public SimpleTableDemo() {
    super(new GridLayout(1,0));
    String[] columnNames = {"A",
    "B",
    "C",
    while (R.next())
    // content of a row
    Object[][] data = {R.getString(1),R.getString(2),R.getString(3)};
    I can't run it because I still can't debug my code which is said before.
    Thx!

  • Error Executing Database Query.coldfusion.sql.DatabaseConnectionException: Timed out trying to establish connection

    My coldfusion service crashes intermitantly and when I check
    the application logs the error that I see for the time frame is the
    one below. Does anyone know where I might begain to solve this?
    Thanks!
    Error Executing Database
    Query.coldfusion.sql.DatabaseConnectionException: Timed out trying
    to establish connection The specific sequence of files included or
    processed is: E:\wwwroot\lifeworks\default.cfm

    I'm no expert, but thought I would try to be helpful.
    I was getting this same error on a regular basis.
    The short term fix was to restart the ODBC server service.
    The long term fix was twofold:
    1. I recreated the ODBC connection in ColdFusion
    Administrator to use the system connection (I was using the SA and
    PW for login).
    2. I created a second user ODBC connection as well as the
    system one under ODBC in Windows Server 2003.
    I haven't had the problem since.
    I also read a pretty good set of "stuff" to try from the help
    area:
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_17277
    Hope this helps.

Maybe you are looking for

  • SXMB_MONI of file2file

    Hi All, I am not able to see any message in SXMB_MONI. I given all the selection creteria,but no message is displayed. i gone through the component monitoring in RWB, there i tested the CC monitoring, if's fine. how can i access the pipeline services

  • Runtime error '2146232576 (80131700)

    Hi all, I am getting runtime error '2146232576 (80131700) Automation error While connecting BI Publisher in MS Word for that if i reinstall BI Publisher can i clear that error.(or) Is it need to reinstall MS Word Give me the conformation immediately

  • CPU utilisation on 11503

    I recently upgraded on of our L4 units to an 11503. Following the upgrade (identical configurations, only interface numbers changing etc) the 11503 is sitting on 100% cpu pretty much constantly. - Everything works, but the box is flat-out. It's very

  • What is being uploaded from my Macbook?

    I've just acquired Telstra Ultimate Mobile Broadband service, and the connection manager reveals large amounts of data being uploaded all the time.  How can I find out what is being uploaded?

  • Error: !next command is internal

    Hello dear community, I have a problem with my several SF300-08 Switches. They lose their uplink port without any interference my myself of my employees. We a I configure the uplink correctly and it works for some time but then the port changes and d