Problem with a query object back to a Java class ColdFusion

Hello!
I need to return a ColdFusion query object from a Java class using a set of JDBC (java.sql.ResultSet) results;

I tried to move my result defined JDBC the constructor of the class coldfusion.sql.QueryTable with this code:


ColdFusion code

< cfset pra = createObject("java","QueryUtil").init () >
< cfset newQuery = CreateObject ("java", "coldfusion.sql.QueryTable") >
< cfset newQuery.init (pra.getColdFusionQuery ()) >

My java class executes a DB query and returns a QueryTable

Code Java (QueryUtil.java)

Import coldfusion.sql.QueryTable; (For the QueryTable class CFusion.jar)
import com.allaire.cfx //(cfx.jar for class Query used from QueryTable)
public class QueryUtil
{
public static coldfusion.sql.QueryTable getColdFusionQuery (rs java.sql.ResultSet)
{
return new coldfusion.sql.QueryTable (SR);
}
}

but when I run the cfm page and coldfusion server tries to run: '< cfset pra createObject("java","QueryUtil").init () = >' this error:

Object instantiation Exception.
An exception occurred when instantiating a java object. The cause of this exception was that: coldfusion/sql/QueryTable.

If I try to run QueryUtil.java with eclipse it all works.

Also, I tried to return a java.sql.ResultSet directly to coldfusion.sql.QueryTable.init () with failure.

Do you know another solution?

Thank you cf_dev2

This is the solution:

If you are using another jar file in your java.class, you must write the path of the jar in the jvm classpath:

-Open C:\CFusionMX7\runtime\bin\jvm.config with a text editor;
-Add at the bottom of the path full fo your jar files
-Save
-coldfusion restar

I thing you can also add the classpath in coldfusion administrator, but I do not know how;

I found only CF classpath.

Hi all.

Tags: ColdFusion

Similar Questions

  • Problem with hierarchical query in function PL\SQL

    I have a simple table containing the ID of the parent

    -Create table

    create the table1 table:

    (

    ID NUMBER (12) not null,

    year number 4.

    month NUMBER (2),

    parent_id NUMBER (12)

    );

    -Create/recreate primary, unique and foreign key constraints

    change the table1 table:

    Add primary key constraint PK_TABLE1 (ID);

    change the table1 table:

    Add the foreign key constraint FK_TABLE1_PARENT (PARENT_ID)

    reference TABLE1 (ID);

    data:

    Insert into TABLE1 (id, year, month, parent_id)

    values (5, 2015, 12, 3);

    Insert into TABLE1 (id, year, month, parent_id)

    values (6 (2015), 12, 4);

    Insert into TABLE1 (id, year, month, parent_id)

    values (3 (2015), 11, 1);

    Insert into TABLE1 (id, year, month, parent_id)

    values (4 (2015), 11, 2);

    Insert into TABLE1 (id, year, month, parent_id)

    values (1, 2015, 10, null);

    Insert into TABLE1 (id, year, month, parent_id)

    values (2 (2015), 10, null);

    commit;

    and query

    with h as

    (select t.id, t.year, t.month, CONNECT_BY_ROOT t.id as parent_id from table1 t

    where t.year = 2015 and t.month = 12

    and CONNECT_BY_ROOT t.year = 2015 and CONNECT_BY_ROOT t.month = 10

    connect by prior t.id = t.parent_id)

    Select * from:

    Join table1 t left t.id = h.parent_id;

    It works, but when I put this request in the procedure pl\sql

    create or replace procedure is get_report (p_cur_out on sys_refcursor)

    Start

    Open the p_cur_out for

    with h as

    (select t.id, t.year, t.month, CONNECT_BY_ROOT t.id as parent_id from table1 t

    where t.year = 2015 and t.month = 12

    and CONNECT_BY_ROOT t.year = 2015 and CONNECT_BY_ROOT t.month = 10

    connect by prior t.id = t.parent_id)

    Select * from:

    Join table1 t left t.id = h.parent_id;             

    end get_report;

    /

    They do not compile. And in the fall, with the exception

    Errors of compilation for the PC of the PROCEDURE. GET_REPORT

    [Error: PL/SQL: ORA-00600: internal error code, arguments: [qctcte1], [0], [], [], [], [], [], [], [], [], []]

    Online: 6

    Text: with h as

    Error: PL/SQL: statement ignored

    Online: 6

    Text: with h as

    My version of oracle

    1Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
    2PL/SQL Release 11.2.0.3.0 - Production
    3CORE Production 11.2.0.3.0
    4AMT for Linux: Version 11.2.0.3.0 - Production
    5NLSRTL Version 11.2.0.3.0 - Production

    What is the problem with my request? Or database? How to solve this problem?

    If you have access to MOS, you can search the reason of it. If you are using left join syntax instead of joining ANSI, owner Oracle procedure compiles and returns the result.

  • Problem with masks at sending back of Speedgrade first (CC)

    Hello

    I'm color ranking a clip in SpeedGrade CC using the new direct link function. For calibration of the colors I used masks and also the different layers. Once I'm done, I sent my sequence back to first Pro CC.

    I see, first shows me exactly the color correction, I did in SpeedGrade, except for one thing:
    The places where I used the masks in SpeedGrade to illuminate their for example a little until now are filled with lines pixeled...
    I thought it's just a problem with the preview, so I exported it. Slept pixeled lines.

    Once again: in SpeedGrade is all fine, but when I send the return sequence to the first there are those pixels.

    It's really irritating because one day before it worked fine with no problems and I was virtually the same as now.

    Please help me if you can! Thank you!

    I even posted in the Premiere Pro forum and got a good answer:
    http://forums.Adobe.com/message/5858747#5858747

  • problem with recording new object database

    Hi all

    I am having some problems with registration of the database object.

    I have 2 classes

    {Test}
    Laboratory Lab - > not nullable in DB
    LastElement-> element (2 part)
    Items in collection-> (a-2-many element)
    }

    Element
    {
    String value
    Test parentTest-> (one to a test - key to building elements)
    }

    1. I create new Test ts1 and new element el1
    2. I add el1 ts1 items
    3. I updated el1 lastElement in ts1
    4 assignSequenceNumbers
    When I will I have an exception for the Insert for Test-> impossible to insert null for LAB_ID

    I found that if I do step 3 everything works fine and the INSERTION is done in a single step (all the attributes private and one-2-one References are included)
    If I do the step 3, only private attributes are generated for the insert and after insertion will update for all individual references. And it would be ok if I wouldn't not nullable fields.

    Is it possible to force Toplink do not separate first INSERTION to 2 calls?

    Any suggestions will be greatly appreciated.

    PS. all objects are correctly saved in UnitOfWork

    Thank you

    First of all you have parentTest in el1? You must take care of both sides of the relationship.
    Secondly, if you did and which does not help, maybe you can change a constraint not null on defered lab so he would be checked at the end of the transaction not to each insertion.

    Published by: sebastian.kolski on October 8, 2009 10:27

    Published by: sebastian.kolski on October 8, 2009 10:28

  • problem with the query insert masking character @.

    Hi the gems...

    I do through xml schema, run... means using a batch file, I'll call the xml files and the xml file contains the names of files containing all the DDLs and LMD...

    No problem with the DDL...

    now when I run the LMD, all are working well except a few insert scripts...

    Insert into TABLE_NAME (EVENT_ID, EVENT_DESC, EVENT_MESSAGE_TEMPLATE, EVENT_MESSAGE_SUBJECT) values (4, 'abcdefgh',)
    'Hi,
    Order details:
    @Order_ID #.
    @Instrument_ID #.
    This is an automated email. Please do not reply.',
    "executed");

    This kind of scripts insert failed with the error "[ora: sqlplus] SP2-0310: could not open the file" Order_ID #, .sql.

    This problem is due to the @ character before the data...

    problem doesn't happen when I run the script explicitly, xml perform only the origin of the problem

    So, I need to know if there is a way to hide the sign @...

    Please help... Thanks in advance

    user12780416 wrote:
    "[ora: sqlplus] SP2-0310: could not open the file" Order_ID #, .sql.

    In SQL * more the @ character means: run a script. That would explain the error message.
    The real problem is that your chain is written on several lines. A string like this might work:

    {code}
    Insert into TABLE_NAME (EVENT_ID, EVENT_DESC, EVENT_MESSAGE_TEMPLATE, EVENT_MESSAGE_SUBJECT) values (4, 'abcdefgh',)
    "Hi," | Chr (10)
    ||' Order of details :'|| Chr (10)
    |' @Order_ID #' | Chr (10)
    |' @Instrument_ID #' | Chr (10)
    ||' This is an automated email. Please do not respond. »
    "executed");
    {code}

    But it might not be a usable workaound.
    As you create the string insert sort, you might be able to replace all line breaks in the present with you own custom lines.

    Replace (yourEventMessage, Chr (10), "' |) Chr (10): "')

  • Problem with a query of xmlt

    Hello

    I need to query this xml file:

    < a > < action id = "1" > < alarm id = "1000" > 3 < / alarm > < alarm id = '1001' > 2 < / alarm > < alarm id = "31" > 2 < / alarm > < / action > < Code action = "3" > < alarm id = "16" > 5 < / alarm > < / has >

    I need to add the action/@id attribute to this query:
    select aa.hour,
           to_number(extract(value(xa),'alarm/@id')) alm_,
           to_number(extract(value(xa),'alarm/text()')) freq_
      from t_alarm_stats aa,
           xmltable('$XML/a/action/alarm' passing aa.x_alarm AS "XML") xa
     where aa.id_device = 3194
       and aa.hour > trunc(sysdate-1);
    I have now the recordset is fine enough:

    time, id_alarm and frequency of the alarm:
    28/03/2011 01:00 1000 3
    28/03/2011 01:00 1001 2
    28/03/2011 01:00 31 2
    28/03/2011 01:00 16 5

    I need to also add the corresponding action/@id, but I don't know how to navigate to a higher level of my xml so that the Recordset:

    time, action id, id_alarm and frequency of the alarm:
    28/03/2011 01:00 1 1000 3
    28/03/2011 01:00 1 1001 2
    28/03/2011 01:00 1 31 2
    28/03/2011 01:00 3 16 5

    Y at - it the possibility to do this with 1 query?

    Thanks in advance,
    Samuel

    Hello

    This should do it:

    select aa.hour
         , xa1.action_id
         , xa2.alarm_id
         , xa2.alarm_freq
    from t_alarm_stats aa,
         xmltable('$XML/a/action'
           passing aa.x_alarm AS "XML"
           columns action_id number  path '@id',
                   alarms    xmltype path 'alarm'
         ) xa1,
         xmltable('/alarm'
           passing xa1.alarms
           columns alarm_id   number path '@id',
                   alarm_freq number path '.'
         ) xa2
    where aa.id_device = 3194
    and aa.hour > trunc(sysdate-1)
    ;
    
  • What is the problem with this query in the source

    A blank page is region 2. Region1: enter rec_no (-rec_no is varchar2) region2:hide and show that displays one record based on rec_ no region1 entered.
    The problem is that I get the following error

    ORA-06550: line 1, column 7: PLS-00428: an INTO clause in this SELECT statement

    Here's my simple query in a process of pl/sql
    Start
    Select rec_no, rec_name from mytable where rec_no = upper(:P16_rec_no);
    end;

    Why? The same query works under the sql command.

    what I'm trying to accompolish here, it is because he has given huge if I want to display hide also multiples, regions and allow users to update each region as a result. Help, please. It kills me that I just can't understand what is causing the problem to the query. Thank you.

    Hello

    The list is set to the field EMPLOYEE_ID itself? What is the primary key of the table? In my example, DEPTNO is the primary key and I used the element generated by the wizard page to display the list. The parameters of the Source of the item itself or the column DEPTNO and database so that the process "process line...". "to identify the updated row.

    Andy

  • Problem with the locale and date serialization in java

    Hello
    I have a serious problem with Flex dates and need a solution as soon as possible. I have a Flex 2 front end that uses remote java objects to talk to the database. I have a Flex 2 DateFields form. The dates of these are stored in the datebase. However I need the dates to be stored exactly as users them selects regardless of the locale.

    What is happening at the moment is we are developing in Ireland and in selecting a date, filling an actionscript VO which is in turn transformed into a java VO (on a server in the United States) and when the date is stored in the database is one day before the date that we have selected. It seems that the flash player uses the locale with a time of midnight (GMT) users. When place the conversion to the EAST, it stores the date (GMT - 5), which causes the being Eve.

    I changed my flex code to set the date at 12: 00 time even if he converts and subtracts 5 hours it will always be the same date. But this does not work, it seems to work sometimes and not others and is very inconsistent. I can't understand why it works sometimes.

    Its makes me mental - someone has experienced this problem or did someone knows a solution PLEASE?
    Thank you

    I'm not very familiar with your specific question, but I wonder if a combination of store dates as the first milliseconds since midnight January 1, 1970, universal time, stored as a string and then when presenting the data are aware, locale would solve the problem.

  • Problems with version 10 of the OPM and Java

    Hello

    After installing OPM 10 I try now to execute the decisions of Oracle's Web, but fail. I know I need to at least Java 1.5, but Recalling the JRE 1.6.0_17 and 1.5 in system JAVA_HOME and OPM Menu-> tools-> options-> development-> Run (of course not at the same time) rules, I get always a message that says I need to at least java 1.5. Now, looking at the documentation, it tells me

    Had a job 10 OPM in mid-December, but after having to change drive and the following facilities from 10 OPM and Java this problem started.

    Someone at - he had the same problems or heard of him?

    Concerning
    / Rickard

    Edited by: user11259027 13-jan-2010 03:20

    Published by: Rickard E on 13-jan-2010 03:26

    I have the feeling that OWD will work if you change your English locale (or anything other than Swedish). There seems to be a problem with the localized JRE.

    Control Panel... Regional and Language Options... Standards and formats

  • problem with access to the properties of the extended classes

    Hello

    Why can't I access the new properties in a class created with a declaration of mother?

    I have classes A and B both extend flash.display.Sprite
    B is a child of a (this.addChild (B) to the instantiation of B to A)

    I can access properties inherited from A to B without any effort (eg parent.x or parent.height, for example) but I can not access new properties, I created in this way (parent.myNewProp will not work)...

    Can someone help me please?

    Thank you.

    then cast parent as:

  • Problem with the query in the form of customization mode

    Hi all

    Can you please help me I'm getting problem while doing the customization form

    Scenario:

    Marter dot org form that I need to display the default value in the field of the unit of MEASURE value is null

    I succeed while doing all the steps below

    Condition tab:
    ----------------------
    Trigger the same: ONCE - NEW - ITEM - INSTANCE
    Trigger object: MTL_SYSTEM_ITEMS. INVENTORY_ITEM_MIR

    Action tab:
    ------------------
    Type: property
    type of object: agenda
    Trigger object: MTL_SYSTEM_ITEMS. PRIMARY_UNIT_OF_MEASURE_MIR
    Property name: VALUE
    Value: null

    but the problem is when I try to query (F11) the form, I'm not able to ask please help me with the of this

    Thank you
    EABR

    The problem is, you assign a value to an element when the form is opened, so the form will update mode, so the system not allowing you to make the request (f11). If you clear the value that has been missed, you'd be able to F11.

    So instead set the VALUE, try the INITIAL_VALUE property and let me know if this worked for you.

    Thank you
    Pradeep

  • Dynamic problem with lookup-query for the purpose of resource request

    Hi all
    I need to set up several IOM user exchange mailboxes, I can set up AD account and account of the mailbox without any problem, but only for the first ad and Exchange account. For the second and third, etc. I get the error: "Invalid login name" during Exchange of account provisioning. I discovered that this problem exists with Exchange Connector - it is not able to collect correct GUID. So in my xml Dataset I use dynamic query Lookup to select manually correct Alias, the login name and GUID. The query for the GUID is the sequel (I cloned RO for AD and Exchnage):

    AttributeReference available-in-bulk = "true" length = "32" widget = 'search query' type = 'String' attr-ref = "Object GUID" name = "Object GUID" >
    * < lookupQuery search-query = "select distinct UD_KFUSER_OBJECTGUID GUID, ud_KFUSER_uid like UD_KFUSER UD_KFUSER, orc orc Login, sta sta where UD_KFUSER.orc_key = orc.orc_key and orc.usr_key = ' $Form data." Take ' and UD_KFUSER. "UD_KFUSER_AD = 27 and orc.orc_status = STA.sta_status AND STA.sta_bucket! = 'Cancelled'" display-field = "GUID" save-field = "Object GUID" / > *.
    * < / AttributeReference > *.


    My questions are:

    1. I have to type * to run the query in the user interface, without * I got error:

    + < 17 February 2012 11:12:22 THIS > < error > < oracle.adfinternal.view.faces.config.ric +.
    h.RegistrationConfigurator > < BEA-000000 > < ADF_FACES - 60096:Server Exception durin
    PPR, #10 g
    oracle.iam.platform.canonic.base.NoteException: an error occurred during executin
    g the search query.
    to oracle.iam.platform.canonic.agentry.GenericEntityLookupActor.perform)
    GenericEntityLookupActor.java:337)
    Is this right?

    2. when I got correct values (from the search query) - they are missing on the details of the application and form of RO - what Miss me?

    I use OIM 11.1.1.5, in my xml dataset I use correct attr-Ref (labels), when I type the values manually, they are propagated to form RO and Exchange mailbox is created.
    Best
    MP

    I not had no problem when writing search query.
    This works very well for me.
    The request will be filled for the field, so why choose *?
    I used as

  • Problem with the C++ object to qml exponent

    Hello, I followed the instructions by Qml and C++ integration but got stuck at a certain time.

    Here is my code:

    // applicationui.cppPage* ApplicationUI::doLoadPageDetails(){
    
        qmlRegisterType("myHtmlPage", 1, 0, "HtmlPage");
    
        QmlDocument *qml = QmlDocument::create("asset:///PageDetails/PageDetails.qml").parent(this);
        qml->setContextProperty("app", this);
    
        HtmlPage *htmlPage = new HtmlPage();
        qml->setContextProperty("htmlPage", htmlPage);
    
        htmlPage->setHtml("*some html code*");
    

    This function creates a Page with a container that contains a WebView. Here, I want to fill the string saved as htmlPage.html.

    I created the RPC classes as described in the link and they work. When I check the htmlPage-> html() in C++, I get the string I wanted.

    Now, my problem is how to get this string for qml.

    Here's what I do:

    import myHtmlPage 1.0....Container {
    ....
            ScrollView {            visible: true
                WebView {
                    attachedObjects: [
                       HtmlPage {
                            id: htmlPage
                        }
                    ]
    
                    id: webViewScrollable1....
                    html: "" +
                    "" +
                   "*style options*" +
                    "" +
    
                    htmlPage.html +  //<----- this should give me the string I saved in C++ under htmlPage->html()
    
                    "" +
                    ""
                }
            }
    

    But nothing is displayed on the page. But why? I forgot to link something?

    I think you're getting confused in the difference between a property and recording a QML component.

    You do both.

    When you attach an object to a QML file, you create an instantiation of the object at this time, when you set a context property that you you already created that object and are just passing a reference to this.

    So when you join HtmlPage in your QML file you create a new object and does not reference that you have created in your program C++ part, so no text.

  • Problem with html/css object in Muse

    I did a project Muse and use widgets, but when I try to measure with the html/css object provided by Muse, the preview works perfectly but when I put it on Business Catalyst, the changes disappeared and he is back to normal...
    What should I do to make the CSS works?

    I don't know how you managed to add css to Jotform. JotForm is broadcast via iframe. Not editable any it by the css on your side. Any change in appearance, you can do in the Online Form Builder · JotForm , non-personalized css.

    Well, if we talk in general. Muse never deletes the user code inserted into the head through the properties of the page. But I do not see any css custom in the source code of your website.

  • PROBLEM WITH SQL QUERY.

    Hi all

    I am executing the following query, which I use to retrieve unique records.


    SELECT OH. ORDER_ID, OH. ORDER_DATE, OH. GRAND_TOTAL, OSI. DESCRIPTION ACE ORDER_STATUS,
    PMT. DESCRIPTION AS PAYMENT_METHOD, TR. AS PAYMENT_STATUS DESCRIPTION
    OF ORDER_HEADER OH INNER JOIN ORDER_PAYMENT_PREFERENCE OPP ON OH. ORDER_ID = OPP. ORDER_ID and
    OPP. CREATED_DATE = (SELECT MAX (CREATED_DATE) OF ORDER_PAYMENT_PREFERENCE WHERE THE ORDER_ID = OH. ORDER_ID)
    PAYMENT_METHOD_TYPE PMT, STATUS_ITEM SO, STATUS_ITEM OSI
    WHERE OPP. PAYMENT_METHOD_TYPE_ID = PMT. PAYMENT_METHOD_TYPE_ID AND
    OPP. BATCH = IF. BATCH AND OH. BATCH = OSI. BATCH AND
    (OH. BATCH = "ORDER_CREATED" | OH. BATCH = "ORDER_HOLD") AND
    OH. "CREATED_STAMP > = ' 2011-12-03 11:41:04.

    Problem I am facing is, for some a few order_ids we have several entries in ORDER_PAYMENT_PREFERENCE with CREATED_DATE even where query return me of duplicate records.
    I applied OPP. "CREATED_DATE = (SELECT MAX (CREATED_DATE) OF ORDER_PAYMENT_PREFERENCE WHERE THE ORDER_ID = OH. ORDER_ID)' forced to get the record, unique, but as I said to few recordings, we have several lines in ORDER_PAYMENT_PREFERENCE corr. ORDER_ID single and multiple records have same CREATED_DATE.

    Can you suggest a few changes, the query to retrieve unique records.

    I know I'm a very abstract information, shortly I'll provide table structure and little info I want in this query.
    It's because of the tight work schedule.


    Thank you
    Jagdeep Singh

    Hello

    Basically, you need to convert a number in his order inside each created_date order_payment_preference. However, if you have more than one created_date which is him even you'll actually choose one of them at random unless you specify an order more squeezed by the clause. For example, you might have a numeric value from a sequence that could be added to determine which input was really the most recent. In any case the following should give you an idea what I mean...

    SELECT
          order_id,
          order_date,
          grand_total,
          order_status,
          payment_method,
          payment_status
    FROM
        (
            SELECT oh.order_id,
                   oh.order_date,
                   oh.grand_total,
                   osi.description AS order_status,
                   pmt.description AS payment_method,
                   si.description AS payment_status
                   ROW_NUMBER() OVER(PARTITION BY opp.order_id ORDER BY opp.created_date DESC) rn
            FROM   order_header oh
                   JOIN order_payment_preference opp ON oh.order_id = opp.order_id
                   JOIN payment_method_type pmt ON opp.payment_method_type_id = pmt.payment_method_type_id
                   JOIN status_item si ON opp.status_id = si.status_id
                   JOIN status_item osi ON oh.status_id = osi.status_id
            WHERE
            AND    oh.status_id IN('ORDER_CREATED','ORDER_HOLD')
            AND    oh.created_stamp >= '2011-12-03 11:41:04'
        )
    WHERE
         rn = 1    
    

    Some notes if - it is not a good idea to mix the styles of the junction between ansi and oracle style, it makes it difficult to follow. Just choose one or the other.

    OH.STATUS_ID='ORDER_CREATED' || OH.STATUS_ID='ORDER_HOLD'
    

    Makes no sense. I took a guess that you meant, OR then I converted to an IN clause that will do the same job.

    HTH

    David

Maybe you are looking for

  • continuous laptop restarting after an update

    When I turn on the laptop the performances last updated 3/3 0% and towers then turns off and restarts and then just did the same thing again and again. I tried the option while pressing F8 on startup to the top and nothing works. Help, please!

  • Need solution for the blinking cursor

    Hi all Whenever I start my laptop (windows 7), the cursor starts to Flash and jump randomly. He continues to go away for a while and then stops automatically. I tried to stop the SPOOL process and updates NVIDIA as suggested on some websites, but it'

  • port channels

    I'm looking on the port channels configured on the FI. And that's all. port channel 21 is (eth 1/27-20) which is connected to the nexus 7000 so, what are the others? (nxos) # sh port-channel summary Flags: D - low P - Up in the port-channel (members)

  • BlackBerry Smartphones Blackberry App World disappeared HELP!

    My blackberry app world has disapearred and I have it has not deleted and can not find anywhere on my phone... How can I get that back... ???

  • Days of developer Virtualbox upgrade to 4.2.5

    Hi allI've successfully upgraded the Unix VM from 4.2.4 to 4.2.5 but unfortunately I got a 503 error and so spent some time looking into the earpiece of the Apex. I solved it by publishing the following textConnectable ALTER DATABASE open read write