Trying to understand a callable statement

i am having trouble understanding CallableStatements
i have this code
Connection conn = null;
try
     conn = OdLauncher.getDbConnection(USERID, PWD, SERVER);     
     CallableStatement cs = conn.prepareCall("{? = CALL " + QUERYPROC + "(?)}");
     //what do i set???
     //what do i register???
     cs.registerOutParameter(1,Types.INTEGER);
     cs.executeQuery();
     System.out.println("cs " + cs);
catch(Exception e)
     e.printStackTrace();
}what i am trying to do is query a stored proc to return a result set
but im having trouble trying to figure out what the difference is between
setting like setString(1, somethinghere);
and registering
cs.registerOutParameter(1,Types.INTEGER);
i am not sure what it is i set and what it is i register???

CallableStatement cs = conn.prepareCall("{? = CALL "
" + QUERYPROC + "(?)}");In this form of syntax for the CallableStatement, the first question-mark [parameter] is the output parameter which is obtained from a RETURN within the stored procedure. For all I know, it is usually an integer to indicate the code [for success or error]. By registering the parameter for output, you can obtain the return value after the execution of the stored procedure using getInt().
As opposed to this the setString() [or whatever yoyu would use for the other parameter] is an input to the stored procedure. I think this is mentioned in the API documentation too.

Similar Messages

  • Trying to Understand Login and State Management

    Hi,
    I'm relatively new to Flex 3.  I'm using the builder.
    Here's my core problem.  I'm coming from a ColdFusion background, where users run to the server for any type of authentication and sessions rule until they're timed out.
    My goal is to understand how ColdFusion (with a SQL Server backend) and Flex work together to help a user login and helps that same user maintain it's state.
    I understand so far that Flex can use a RemoteObject to go back and use ColdFusion services to authenticate a user.  I'd like to go this route.
    My problem is understanding how does Flex maintains information about the particular logged in user.  Am I correct in thinking that once I return information from ColdFusion about the user, I create a global object in Flex that keeps the user's information that I can refer to as I transition between the View States (states) in my Flex application?  And I can just refer to that local user object if I need to make sure I'm still dealing with the same user? 
    Is it really that simple?  Also, I've had been trying to review COUNTLESS articles on the Login/Authentication process.  One that I came across suggested placing a UUID on the server for a particular logged in user, and then I just return that back to Flex.  Does anyone recommend that?  I know that when I used sessions in ColdFusion, the server did this, so I'm not sure which routes to take. 
    By the way, I'm designing an Intranet that's only accessible from our internal network, but I want my colleagues to be able to login securely.  And like I said before, I'm using  ColdFusion (and CF services), SQL Server, and Flex 3. 
    I'm teaching myself Flex through the Video Training - Flex 3, but haven't seen much on this yet.  If someone could provide a good outline of the Best Practices to Login, Authenticate, and Maintain Session State throughout a Flex Application (using a ColdFusion and SQL Server backend), I'd be highly appreciative. 
    Thanks!
    mfho

    Hi,
    Thanks for responding.
    Here's one solution I found located on http://www.blogna.org/blog/adobe-flash/flex-and-flash-rias-authentication-sessions-scalabi lity/#comment-843
    A user submits their username and password inside a Flex form.
    ColdFusion Server receives the username and password and verifies them against the users in a database.
    If the user is valid, A KEY IS CREATED, stored in the database with a time stamp, then sent back to the user.
    The key is stored in a local variable inside the Flex application.
    Now, any time the application needs to retrieve data from a service that requires the user to be logged in, it will pass the key with the request. So, instead of a method like getUserInfo(), now it will look like getUserInfo(key).
    The service will use the key to determine if the user is authenticated, and if they are, it will send back the appropriate data.
    Here are my questions:
    1.  Do I have to have a key sent back to Flex?  Can't I just pull all of the data for that particular user at the time and send it back to Flex?
    I guess I'm not understanding first why I need a key or session id from ColdFusion, but if I do, I guess I could create it using the CreateUUID() in ColdFusion, send it back to Flex, store it in a local var and then reference that each time I needed to do something that's user sensitive.
    Would that work?
    I guess I'd prefer not to use a session ID if I don't have to.
    Thanks!
    mfho1

  • Trying to understand the PAUSE statement

    I am trying to use the following code:
    SET SERVEROUTPUT ON VERIFY OFF
    ACCEPT i_name PROMPT 'Enter your name: '
    DECLARE
         v_name VARCHAR2(30) := '&i_name';
    BEGIN
         dbms_output.put_line('This is right before the PAUSE.');
         PAUSE 'Adjust paper and press RETURN to continue.';
         dbms_output.put_line('Your name is: ' || v_name);
    END;
    /But I am receiving these errors:
    ORA-06550: line 5, column 8:
    PLS-00103: Encountered the symbol "Adjust paper and press RETURN to continue."
    when expecting one of the following:
    := . ( @ % ;
    The symbol ":=" was substituted for "Adjust paper and press RETURN to
    continue." to continue.Am I allowed to use the PAUSE statement within the PL/SQL block, or does it have to be before the DECLARE statement?
    If I am allowed to use it within the block, then why am I receiving an error? I tried both with and without the semicolon at the end of the PAUSE statement.
    On this site: http://download.oracle.com/docs/cd/A87860_01/doc/server.817/a82950/ch8.htm#1001319 it has the following example:
    SET PAUSE OFF
    PAUSE Adjust paper and press RETURN to continue.
    SELECT ...But why would you turn the pause OFF? And then when do you turn it ON? Also, that example seems to conflict with the advice listed here: http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12040.htm#i2699261
    Which says: "You need to first, SET PAUSE text, and then SET PAUSE ON if you want text to appear each time SQL*Plus pauses."

    Pause is a sqlplus command so, no you cannot use it in a PL/SQL block. It is used to stop the display from scolling, generally after pagesize lines. It can also be used, as in the example you posted to stop the display and give some feedback to the user.
    The set pause off command will make sqlplus display all the output without stopping. The explicit pause <text> is a command that stop the display. You can set pause on so the display will stop after every pagesize lines. You can also do something like set pause Press any key to see more and the display will pause after pagesize lines anf disply the text in the set pause command as a prompt.
    You do know that this is all documented in the SQL Plus Users Guide right?
    John

  • Using A callable statement in java

    Hi all im trying to get results back from the database using a callable statement the problem is that it is placing / infront of single quotes.I need to get rid of this because it's not returning anything
    here is my code
    CallableStatement statementOne;
    statementOne = ComparitiveAnalysisGUI.conn.prepareCall("{call graphProc(?,?,?,?,?,?,?)}");
    statementOne.setString(1,"\"date_format(calldate, '%Y-%m-%d H:59:59'),avg(billsec)\"");
    statementOne.setString(2,"Clovercdr");
    statementOne.setString(3,start);
    statementOne.setString(4,end);
    statementOne.setString(5,"Boksburg");
    statementOne.setString(6,"\"billsec > 0 and Network = " + network + "\"");
    statementOne.setString(7,"\"date_format(calldate, '%Y-%m-%d %H:M:S')\"");
    System.out.println(statementOne.toString());
    rs = statementOne.executeQuery();
    the result of the println is
    com.mysql.jdbc.CallableStatement@ec4a87: CALL graphProc('"date_format(calldate, \'%Y-%m-%d %H:59:59\'),avg(billsec)"','Clovercdr','\'2006-03-14 00:00:01\'','\'2006-03-14 23:59:59\'','Boksburg','"billsec > 0 and Network = \'SAMobile\'"','"date_format(calldate, \'%Y-%m-%d %H:M:S\')"')
    as you can see quite a mess please help if you can get the statement to look as follows
    CALL graphProc("date_format(calldate, '%Y-%m-%d %H:59:59'),avg(billsec)",'Clovercdr','2006-03-14 00:00:01','2006-03-14 23:59:59','Boksburg',"billsec > 0 and Network = 'SAMobile'","date_format(calldate, '%Y-%m-%d %H:M:S')")
    thanks Brian

    Ok in order to understand why I did what I did parhaps it would be best if you saw my Stored procedure
    create procedure graphProc(col varchar(100),company varchar(20),startTime datetime,endTime datetime,branchName varchar(20),andSection varchar(200),groupSec varchar(100))
    BEGIN
    SET @stmt := CONCAT("SELECT ",col," from ",company," where calldate between '",startTime,"' and '",endTime,"' and branchName = '",branchName,"' and ",andSection," Group by ",groupSec);
    PREPARE stmt1 from @stmt;
    EXECUTE stmt1;
    the call is for example
    call graphProc("date_format(calldate, '%Y-%m-%d %H:59:59'),avg(billsec)",'Clovercdr','2006-03-01 00:00:01','2006-03-14 23:59:59','Boksburg',"billsec > 0 and date_format(calldate, '%k') BETWEEN 7 AND 19 and Network = 'SAMobile'","date_format(calldate, '%Y-%m-%d %H:M:S')")//
    as you can see In MySQL the "date_format(calldate, '%Y-%m-%d %H:59:59'),avg(billsec)" has to be quoted like this, so it can recognise it as a single parameter, since , '%Y-%m-%d %H:59:59' is viewed as another parameter
    thaks for your reply
    Brian

  • Calling a procedure/function in CO using Callable Statement

    Hi,
    Please help me in understanding this:
    __method1__
    BEGIN
    :1 := Package.Function(
    param1 => :2"
    ,param2 => :3"
    ,param3 => :4"
    ,param4 => :5"
    END;
    method2
    BEGIN
    Package.Function(:1, :2, :3, :4, :5);"
    END;
    Whats the significance of using method1?
    I have seen the callable statements written as in method1 but, the parameters passed are not in order and not all params are passed.
    When i tried writing similar code, I got "Invalid Column Index" exception. Please let me know how to overcome this.
    Thanks

    Hi,
    You can call a function using Callable Statement as
    public String checkprimarycontact(String pri_loc_id,String org_id,String party_id)
    int p_location_id = 0;
    int p_org_id = 0;
    int p_party_id = 0;
    p_location_id = Integer.parseInt(pri_loc_id);
    p_org_id = Integer.parseInt(org_id);
    p_party_id = Integer.parseInt(party_id);
    String priflag = "";
    try
    Connection conn1 = getOADBTransaction().getJdbcConnection();
    CallableStatement cstmt1 = conn1.prepareCall("{? = call GET_PRIMARY_FUNCTION(?,?,?)}");
    cstmt1.registerOutParameter(1,Types.VARCHAR);
    cstmt1.setInt(2,p_location_id);
    cstmt1.setInt(3,p_org_id);
    cstmt1.setInt(4,p_party_id);
    cstmt1.execute();
    priflag = cstmt1.getString(1);
    catch(Exception e1)
    e1.printStackTrace();
    return priflag;
    Thanks,
    Gaurav

  • Trying to understand the basic concept of object oriented programming.

    I am trying to understand the basic concept of object oriented programming.
    Object - a region of storage that define is defined by both state/behavior.
    ( An object is the actual thing that behavior affects.)
    State - Represented by a set of variables and the values they contain.
    (Is the location or movement or action that is the goal that the behavior is trying to accomplish.)
    Variables- (What does this mean?)
    Value - (What does this mean?)
    Behavior - Represented by a set of methods and the logic they implement.
    ( A set of methods that is built up to tell's the how object to change it's state. )
    Methods - A procedure that is executed when an object receives a message.
    ( A very basic comand.For example the method tells the object to move up, another method tells the method to go left. Thus making the object move up/left that combination is the behavior.)
    Class - A template from which the objects are created.
    ( I am very confused on what classes are.)
    - The definitions of the words I obtained from the "Osborne Teach Yourself Java". The () statements are how I interperate the Mechanisms (I do not know if Thats what you call them.) interact with each other. I understand my interpretation may be horribly wrong. I will incredibly appreciate all the support I may get from you.
    Thank you

    Object oriented programming is a replacement for the older idea of procedural programming (you can research procedural programming in google). As I understand it, in procedural programming, you have a step by step set of function calls to accomplish some task. Each function receives a data structure, manipulates it, and passes it to the next function. The problem with this is that each function preforms some action for the overall task and can't easily be reused by some other task. Its also harder to read the flow of what is happening with raw data structures flying all over the place.
    In object oriented programming, an object calls a function of another object and receives back, not a data structure, but another object. Objects contain a data structure that can only be accessed by its functions. An object is not so much a sub component of a bigger task, as it is a service that any other task can use for any purpose. Also, when you pass an object to the caller, the caller can ask questions about the data structure via its functions. The developer doesnt have to know what the previous function did to the data by reading up on any documentation, or having to reverse engineer the code.
    I suggest the best way of learning this is to code something like a library object.
    A library object contains a collection of book objects
    A book object contains a collection of chapter objects
    A chapter object contains a collection of paragraph objects
    A paragraph object contains a collection of sentence objects
    A sentence object contains a collection of word objects.
    Add functions to each object to provide a service
    Example: A library object should have a:
    public void addBook(Book book)
    public Book getBook(String title)
    public boolean isBookInLibrary(String title)
    The key is to add functions to provide a service to anyone who uses your object(s)
    For example, what functions (service) should a paragraph object provide?
    It shouldn't provide a function that tells how many words there are in a sentence. That function belongs to a sentence object.
    Lets say you want to add a new chapter to a book. The task is easy to read
    if you write your objects well:
    Sentence sentence1=new Sentence("It was a dark and stormy night");
    Sentence sentence2=new Sentence("Suddenly, a shot ran out");
    Paragraph paragraph=new Paragraph();
    paragraph.addSentence(sentence1);
    paragraph.addSentence(sentence2);
    Paragraphs paragraphs=new Paragraphs();
    paragraphs.addParagraph(paragraph);
    Library library= new Library();
    library.getBook("My Novel").addChapter("Chapter 1",paragraphs).
    Now, lets say you want to have a word count for the entire book.
    The book should ask each chapter how many words it contains.
    Each chapter should ask its paragraphs, each paragraph should ask
    its sentences. The total of words should ripple up and be tallied at each
    stage until it reaches the book. The book can then report the total.
    Only the sentence object actually counts words. The other objects just tallies the counts.
    Now, where would you assign a librarian? What object(s) and functions would you provide?
    If written well, the project is easily extensible.

  • Please, Not getting result set from callable statement (Code posted)

    I am posting some simple code which should get a ResultSet from a CallableStatement object using the executeQuery() Method.
    It is returning "No RsultSet was produced"
    If I modify the code and simply output the CallableableStatement using its executeUpdate() then getString() methods it works fine. Anything obviously wrong with this bit of code? Thanks.
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import db.util.query.*;
    import db.util.pool.*;
    public class oracle extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    response.setContentType("text/html");
    java.io.PrintWriter out = response.getWriter();
    Connection con = ConnectionFactory.getConnection();
    CallableStatement cs = null;
    ResultSet rs = null;
    int intID = 1;
    try{
    cs = con.prepareCall("{? = call test1(?)}");
    cs.registerOutParameter(1, java.sql.Types.VARCHAR);
    cs.setInt(2,intID);
    /*These lines work on their own
    *cs.executeUpdate();
    *out.println("Name is : " + cs.getString(1));
    //this code is what is not working...hmm
    rs = cs.executeQuery();
    while(rs.next()){
    out.println(rs.getString("name"));
    rs.close();
    cs.close();
    //the rest of this works too.
    ConnectionFactory.releaseConnection(con);
    catch(SQLException e){
    out.println(e.getMessage());
    Here's the stored procedure. I'm just trying to do a simple test to return multiple rows. The table has numberous records with the same id which is being passed to the function.
    create or replace function test1 ( strInputID IN testtable.id%type)
    return varchar2
    is
    strOutputName testtable.name%type;
    found_it EXCEPTION;
    begin
    select name into strOutputName from testtable
    where id = strInputID;
    raise found_it;
    exception
    when no_data_found
    then
    return null;
    when found_it
    then
    return strOutputName;
    end;

    I've posted the code...it's doing a select. I think the problem is that to return multiple rows I need to return a cursor. But I've run into problems with both the MS and Oracle Drivers.
    All I really want to do is to query a database using a callable statement(function in oracle) which will return multiple rows which I can process. I have been trying to do this in a servlet.
    I can do it successfully for one column from one row, but not multiple columns from mulitple rows.
    I've been searchging for some good examples and am trying different things but can't seem to get it to work.

  • Trying to understand and learn how to use btrfs

    I have been the past days trying to get my head around how btrfs works
    I have been trying tools like mkinitcpio-btrfs (very poorly documented) and now, if i list the subvolumes i have in certain volume (/) i see i have 4 subvolumes that have been created while playing around.
    If i try to delete them with "sudo btrfs subvolume delete __active", for example, I get a "ERROR: Error accessing '__active'
    What am I doing wrong?
    Also, I cannot get the whole idea about the difference between snapshots and subvolumes, i mean, a snapshot should be a directory that saves the changes made on the fs, s, if you want to roll back those changes, you just have to make btrfs "forget" the changes stored in that directory and move along, but I cannot take the idea of the subvolume thing.....
    As btrfs is quite experimental and the wikis are not noob-proof still, I'd appreciate if someone gave me a hand trying to understand these concept...
    For the moment, I'm just using it on a test computer and on a personal laptop with no fear of data loss,.
    Any help is welcome
    Thanks!
    Last edited by jasonwryan (2013-07-19 23:13:27)

    I honestly think it is probably a better idea to not use mkinitpcio-btrfs.  As mentioned above, it is poorly documented, and for me it has never worked right (if at all).  It is an unofficial AUR package, and unfortunately our wiki still seems to give the false impression that using this package is the way to user btrfs with Arch.
    The way I have my system set up is that in subvolid=0 (the root of the btrfs filesystem) I have a rootfs subvolume and a home subvolume (there are others, but these are what primarily make up my system).  So in my fstab, I basically have two nearly identical lines, but one has no subvol specified and is mounted at /, and the other has 'subvol=home' mounted at /home. 
    So in order to make it so that I can change the root filesystem as I please, instead of having the / fstab entry specify the subvolume, I put it in the kernel command line.  That is, I have 'rootflags=subvol=rootfs' in the kernel command line.  So if I want to change it, I simply change the path to one of the snapshots. 
    Just remember that if you are one who likes a custom kernel, it is likely that you will have to have an initamfs no matter what you compile into your kernel.  For one thing, the kernel has no mechanism for scanning for multiple device btrfs filesystems.  But also, I have read that the kernel itself cannot handle the rootflags kernel command line argument.
    Oracle Linux does something interesting with their default setup.  They are not a rolling release, so this probably wouldn't work so well in Arch Linux, but they actually install the root filesystem (I think it is actually done to subvolid=0) and then after installation of the packages, a snapshot of the root filesystem is made, and the system is setup to boot off of that snapshot.  So it is almost like having an overlayfs on openwrt.  There is always a copy of the original system, and and changes that are being made are being done "on top" of the original.  So in the event of an emergency, yo can always get back to the original working state.
    If you put your root filesystem on something other than the root of the btrfs filesystem (which you should, as it makes the whole setup much more flexible), then you should also set up a mountpoint somewhere to give administrator access to the filesystem from subvolid=0.  For example, I have an autofs mountpoint at /var/lib/btrfs-root.   chose that spot because /var/lib is where devtools puts the clean chroot.  So it seemed as reasonable a place as any.
    You should go to the btrfs wiki, and peruse through the stuff there... not our wiki, but the actual btrfs one, as our wiki is pretty sparse.  There is not all that much content there (not like the Arch wiki), but it does cover the features pretty well.  I mean, there is certainly quite a lot for being information on only a single filesystem, but it shouldn't take you too long to get through it.  There are a few links to articles about midway down the front page.  What really gave me a better grasp of getting started with btrfs were the ones titled "How I Got Started with the Btrfs Filesystem for Oracle Linux" and "How I Use the Advanced Capabilities of Btrfs".

  • Trying to understand problems that occur when redistributing between two OSPF processes

    Hi all, I'm currently brushing up on my OSPF and trying to understand the problems that can occur when redistributing between two OSPF processes. I have read and understand (I think!) the issues caused by the fact that the same route submitted by two different OSPF processes may not necessarily follow the OSPF rules that one would expect - for example, OSPF preferring intra-area routes to inter-area routes to external routes, but only within the same process. So, if the same route is submitted from two different processes, that rule goes out the window.
    But I'm having some difficulty getting my head around the idea of setting the administrative distance lower in one OSPF process to prefer one domain over the other. I just can't quite follow the example described in this document:
    http://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/4170-ospfprocesses.html#twored
    Specifically, in figure 4 where two external networks - external network "N" originating in OSPF domain 1, and external network "M" originating in OSPF domain 2 - are redistributed via two ASBRs. The explanation states:
    This sequence of events could occur occur:
    Router A (Router B) redistributes M into Domain 1, and external M will reach Router B (Router A).
    Because the administrative distance of Domain 1 is lower than Domain 2, Router A (Router B) will install M through Domain 1 and will set to maxage its previous originated LSA (event 1) into Domain 1.
    Because M has been set to maxage in Domain 2, Router A (Router B) will install M though Domain 2 and, therefore, will redistribute M into Domain 2.
    Same as event 1.
    I can't quite work my way through this. I guess it must have something to do with the redistribution of "M" from domain 2 into domain 1 being learned by both ASBRs due to the lower administrative distance assigned to external routes in domain 1, and the original routes through domain 2 being deleted, but then I can't follow the rest of the description. And I can't understand why this would be a problem for network "M" in OSPF domain 2, but NOT for network "N" in OSPF domain 1.
    Any explanation gratefully received!
    Thanks, Graham

    Hello.
    You are right - whenever A and B learns about "M" from Domain 2, they craft LSA for domain 1 and inject it simultaneously. They learn each other's LSAs simultaneously and withdraw (set timer to 3600) for previous LSAs. And it might flap infinitely.
    If they don't learn LSA simultaneously (let's say that A is much faster then B), then there will be no flaps, but B would learn all Domain 2 routes (not just redistributed) via Domain 1.
    And later you will observe routing loop (when you stop advertising M from D): A knows "M" from Domain 2 and injects into Domain 1, B knows from A via Domain 1 and injects into Domain 2... so "M" stays in the routing tables due to mutual redistribution.
    You don't have similar (flap) issue with network "N", because admin distance is lower for Domain 1, so both routers would never prefer OSPF via Domain 2! But having no issue with route flaps, you still will observe routing loop if you stop advertising "N" from C.

  • Trying to understand Provides Dependency type

    I am trying to understand the Provides dependency type. I have
    reviewed the online documentation, but I'm not quite there yet.
    I have a SQL script, with a create table statement, to create
    the CUST table. When I parse the SQL script, I think I should
    get a Provides dependency with a subtype of Created. However, I
    don't get any Provides dependency types.
    Am I missing a step? Do I need to create something else? Or
    have I completely missed the boat?
    Thanks!
    Vini

    Vandana,
    What you see is the way the Dependency Manager is designed to
    work. When you parse a file or object it looks for things it
    provides and things it uses.
    In the case of a ddl script with a create table statement the
    dependency tables will populated with provides dependencies for
    the table and the columns. If this is all you have parsed, and
    you use the dependency manager to show the dependencies for ddl
    file you will see no dependencies in the right hand side results
    pane. This is correct. In the left hand pane of the Dependency
    manager you expand the ddl file node you will see the table(s)
    created in the file. These are the provide dependencies.
    (As an aside, if you parse an Oracle Form and select the form in
    the Dependency manager left pane, you can expand the node and see
    all the blocks and items etc in the form. This is because the
    form "provides" all these "things" that maybe subclassed into
    other forms)
    If you subsequently parse other objects/files that use the table
    then you will see the dependencies between them in the right hand
    pane.
    The slightly confusing part is if you have modelled the table in
    Designer as well as stored the ddl that creates the table the
    dependency manager doesn't show dependencies between them. The
    product just treats these as two providers of the same table. So
    this means when look at, say a form that uses the table, the
    dependency manager will show that the for uses both file and
    modelled table.
    I hope this makes things clearer
    Regards
    mark

  • Trying to understand variables in Edge Animate

    I am writing ALL my code in the document.compositionReady window and have a few questions.
    1. I am trying to understand the use of sym.setVariable() vs using the var keyword. It seems that if I declare
    var myVar = "test" then the variable myVar is available in all my functions further down the code. So when would I use sym.setVariable("myVar","test")?
    2. Since I am writing all my code on document.compositionReady is it possible to edit the code in Dreamweaver. (I like the find and collapse functions in DW). I tried opening the edgeActions.js file and making some edits but they did not seem to always work.
    3. Back to variables. If I define a variable within a function by using the var keyword, it seems to only be available within that function. Is that true? How do I define a variable in a function that is available globally?
    4. Clearly I am mixing javascript, jquery and edgeAnimate API in my code. Is that ok? I am making my animations work but concerned that I am not doing this efficiently/effectively.
    Thanks for any tips, advice, comments.

    Hi, Marlene-
    #2: You should be able to use any editor to edit the edgeActions.js file.
    #1,3: Variables can be declared for local scope (within the function) and attached to various scopes within the composition.  I tend to use variables attached to various symbols to maintain state within that particular scope.  For instance, in the floral sample file, I attached the game score to the game board symbol so that when it was destroyed and recreated, it would reinitialize to 0.
    http://html.adobe.com/edge/animate/showcase.html
    #4: That should be fine.
    Hope that helps answer some of your questions!
    -Elaine

  • Statement closed when using callable statements with oracle xe

    hi all, i've got this problem with oracle express edition 10g. I am using also oc4j v10.1.2.0.2. When working with a normal oracle database it was working fine (i think the code was the same, it's some time since i last tried, but you can see the code is very simple).
    So i just create a callable statement like this:
    CallableStatement cs = con.prepareCall(sentencia.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE, ResultSet.HOLD_CURSORS_OVER_COMMIT);
    and then when trying to access the statement to register an out parameter like this
    cs.registerOutParameter(1, parámetros[0].getTipo());
    it gives this error:
    java.sql.SQLException: Statement was closed
    It's puzzling me because, as i said before, i think the same code was working ok with a normal oracle database.
    Any idea what can it be?
    cheers

    Ah okay, sorry I've re-read your post.
    I believe you need to create a clob object that encapsulates your xml file.
    I've never done this but I would image it involves creating a class that implements the clob interface and passing an instantiation of this class to the callablestatement.
    Let me know how you get on.

  • What may be the cause of this error java.sql.SQLException: invalid sql type passed to callable statement in iplanet ussing JNDI

     

    Hi,
    The possibilities can be of various reasons, with the sql statements,
    xml descriptors, data sources, improper drivers anything. To crack down
    the solution, kindly let me know the error messages and what exactly are
    you trying to accomplish.
    Thanks & Regards
    Raj
    manimaran t wrote:
    what may be the cause of this error java.sql.SQLException: invalid sql
    type passed to callable statement in iplanet ussing JNDI
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Callable statement problem-very urgent

    Hi Friends,
    i have 2 tables, in that two tables one column have same attribute column. when i update the first table through OAF page, i wanted to effect updated value in second table of that common field also. i wrote PL/SQL Procedure and called that into OAF by using callable statements. here first time i updated in the page, updated value is effecting into the first table while second table not effected the updated value. again i am trying to update the page this time in second table effected with first time updation value,while first table updated correctly. suppose i updated again in the page this time in second table effected with second time updation value, while first table updated correctly.this process continuing...
    example – I want to update forecast(this field is in two tables) value filed. Now forecast value is 10 in both tables , I updated as 20. this 20 updated value effected first table while second table forecast field is not effected.
    Again I am going to update value 30 in the place of 20. this 30 updated value effected first table while second table forecast field is 20(firstupdated value) effected.
    Again I am going to update value 40 in the place of 30. this 40 updated value effected first table while second table forecast field is 30(secondupdated value) effected this process continuing...
    Can any one help me out this problem
    This is I have written in AM-
    public void Callable()
    String forecast="";
    String name="";
    String product="";
    String business="";
    XXProgsVOImpl vo = getXXProgsVO1();
    RowSetIterator rowsetiterator=vo.getRowSetIterator();
    rowsetiterator.reset();
    while(rowsetiterator.hasNext())
    Row row = rowsetiterator.next();
    forecast=row.getAttribute("Forcast").toString();
    name=row.getAttribute("Name").toString();
    product=row.getAttribute("Product").toString();
    business=row.getAttribute("Business").toString();
    String s="BEGIN do_update(?,?,?,?);End;";
    OADBTransaction dbtrans=getOADBTransaction();
    OracleCallableStatement cs=(OracleCallableStatement)dbtrans.createCallableStatement(s,4);
    try
    cs.setString(1, forecast);
    cs.setString(2, name);
    cs.setString(3, product);
    cs.setString(4, business);
    cs.execute();
    dbtrans.commit();
    cs.close();
    catch(SQLException e)
    System.out.println(e.getMessage());
    Thanks and Regards,
    vamshi

    Hi Sumit and Thiago,
    Thanks for your information, my Both VO's are coming from EO'S. but first VO I have done some calculation on columns, that calulated value parameter passing to second page. this calculated value is the database column in second table. here when i update the calculated value in updated page , i want to effect this in second page table.
    do you have any work around this..
    Thanks and Regards,
    vamshi

  • Callable Statement Exception

    Hi,
    I am very new to Java SQL Callable Statement.
    The following is the program that i wrote to execute a Stored Procedure stored in MS SQL Server 2000.
    In my program I am actually retrieving back the value that I've passed to the MS SQL Server.
    ========================================
    import java.sql.*;
    import java.sql.Types;
    public class CallableTester
         private Connection connection;
         public CallableTester(Connection conn)
              connection = conn;
         public void executeInsert ()
         CallableStatement stmt = null;
         String sqlstmt;
         int rows;
         try {
              sqlstmt = "{ ? = call product(?, ?, ?, ?) }";
              stmt = connection.prepareCall(sqlstmt);
              stmt.setString(1, "61");
              stmt.setString(2, "62");
              stmt.setString(3, "63");
              stmt.setString(4, "67");
              stmt.registerOutParameter(1, Types.VARCHAR);
              stmt.executeUpdate();
              connection.commit();
              System.out.println("The value inserted are " + stmt.getString(1));
              stmt.close();
              System.out.println(sqlstmt);
         catch (Exception e){
              e.printStackTrace();
    =========================================
    The is no syntax error.
    When I run the program, I've got the following exception
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect
    or syntax error
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6106)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
    at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:2567)
    at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedState
    ment.java:217)
    at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(JdbcOdbcPrepare
    dStatement.java:139)
    at CallableTester.executeInsert(CallableTester.java:38)
    at DatabaseConnection.makeConnection(DatabaseConnection.java:22)
    at Start.main(Start.java:16)
    =========================================
    My database has a table named Product with the following fields and properties.
    Field id of type varchar
    Field name of type varchar
    Field costPrice of type decimal
    Field sellPrice of type decimal.
    =========================================
    The stored procedure for this table is
    CREATE PROCEDURE product @id varchar(8) = 8, @name varchar(50) = "productName", @costprice decimal = 88, @sellprice decimal =168 AS
    INSERT INTO PRODUCT VALUES(@id, @name, @costprice, @sellprice, @desc)
    GO
    =========================================
    Can anyone please to help me? I have been trying to solve this problem few days but I really can't.
    Your help will be appreciated.
    Thank you very much.

    I've reproduced your code with some modifications to make it work, I've tested it against a Sybase DB which is close enough to MS SQL Server.
    First the procedure. Note that I create and write to a temp table you can ignore this.
    create proc dmjtest
      @id varchar(8) = '8',
      @name varchar(50) = 'Dave Jenkins',
      @costPrice decimal = 1.23,
      @sellPrice decimal = 4.56
    as
    begin
      declare @rc int
      select @rc = 0
      create table #t (
        id varchar(8),
        name varchar(50),
        costPrice decimal,
        sellPrice decimal
      insert #t values (@id, @name, @costPrice, @sellPrice)
      if @@error = 0 select @rc = 1
      drop table #t
      return @rc
    endNow for the java code
    import java.sql.*;
    import java.sql.Types;
    public class CallableTester
      private Connection connection;
      public CallableTester(Connection conn) {
        connection = conn;
      public void executeInsert () {
        CallableStatement stmt = null;
        String sqlstmt;
        int rows;
        try {
          stmt = connection.prepareCall("{ ? = call dmjtest(?, ?, ?, ?) }");
          stmt.registerOutParameter(1, Types.INTEGER);
          stmt.setString(2, "1");
          stmt.setString(3, "product 1");
          stmt.setDouble(4, 63.0);
          stmt.setDouble(5, 67.0);
          stmt.executeUpdate();
          connection.commit();
          System.out.println("The return value is " + stmt.getInt(1));
          stmt.close();
        catch (Exception e){
          e.printStackTrace();
    }

Maybe you are looking for