I write a simple procedure, but in java, execute function can't work

I made a very simple procedure in oracle logged as internal user.
the procedure as the following:
create or replace procedure temptest
as
begin
insert into indextab(idx) values(100);
commit;
end temptest;
in Java program,I use Oracle's jdbc driver to connect database, still connect as internal user.
I can call statement.executeUpdate("insert into indextab(idx) values(100)"). and 100 row was added in database.
then,I delete this row, try to run procedure in java,
but the call of statement.execute("temptest") throw a exception
the error message is:"java.sql.SQLException: ORA-00900: invalid SQL statement"
then, I write the same procedure in sql server.
all things work right.( I use jdbc-odbc bridge connect to sql server database)
who can tell me what's the reason?
I'm so urgent, please help me as soon as fast, thank you very much

Hi
You should call the stored procedure using Callable statement .
The call should be like this
CallableStatement cs = con.prepareCall("{Call tempest}" );
cs.execute();
You can also set parameters using functions of callable statement
Hope this helps
Chandar

Similar Messages

  • After updating OS X 10.8.5, bluetooth is not available in the menu bar. The Magic Mouse is recognized and working but the bluetooth mouse functions do not work.

    After updating OS X 10.8.5, bluetooth is not available in the menu bar.
    The Magic Mouse is recognized and working but the bluetooth mouse functions do not work.
    I have downloaded and installed 10.8.5 combo but it does not help.
    Menu bar - System Preferences/ there is no bluetooth item
    I restarted with cmd + alt + P + R it doesn't help.

    Did you try the suggestions from your other post on this?

  • I have acrobat pro on my lap top and recently installed acrobat pro on my Mac Mini, but the text recognition function is not working, does anyone have any advice on how to remedy this problem?

    I have acrobat pro on my lap top and recently installed acrobat pro on my Mac Mini, but the text recognition function is not working, does anyone have any advice on how to remedy this problem?

    On my laptop when I open up a pdf file and do a search for a particular
    text phrase it prompts me to run a character analysis.  Whereas on my mac
    mini, when I try to engage the same process it just says it couldn't find
    the phrase and doesn't even try and run a character analysis. I tried
    clicking on the tool bar and the recognize text tab but nothing there seems
    to do anything.
    In trying to figure out the issue on my own I noticed one thing.  I run a
    small law firm in St. Louis and I scan in all my files to which are
    subsequently emailed to my outlook account where I will save them as pdf's
    to their respective folders.  On my laptop when I open up an email from my
    scanner I see the image of a acrobat document next to the attachment
    paperclip symbol.  However, when I open up the same email on my mac mini I
    notice instead of an acrobat file image it shows a Preview file image (the
    program used to open up pdf's before I installed acrobat).
    Hope this helps!
    Sincerely,
    Jonathan McAllister

  • HT5772 How do you delete a movie from a local computer without deleting it from the library?  This should be such a simple procedure, but it's not. And while we're at it, why is iTunes NOT one of the dropdown product choices?

    All Apple support says about deleting movies from a computer is that you "should" be able to re-download it if you live in the right area.  Well, I'm in the U.S.A. and just deleted one of the movie extra features exactly as described in the support directions.  According to Apple I should be able to re-download this from the cloud at any time, but now I no longer even see the title listed.  That's why I wanted to test their support statements with a Movie Extra instedad of a real movie.  This should be the simplest of tasks to manage, yet they make it extremely difficult.  Why?  I own the movies and I want them to stay in my iTunes library basically forever.  Makes sense, right?  But, I only have so much room on my laptop to store movies that I want to have with me on long trips, etc.  So if I only have the space to store 3 or 4 movies on the disk, shouldn't I have the ability to every once in a while delete one of those movies from my local computer ONLY, NOT my library, so that I can download a different movie?  Yet the first thing iTunes does when you hit the delete key is tell you that it will remove the movie forever from all devices and the library.  So why does support say you can download again any time from the cloud then?  The worse part is, the calamity doesnt stop there.  Wait until you see the message you actually get once you say that yes, you do want to delete the movie (but only because you assume that you really can download it again sometime).  Here is the exact 2 messages you get from Apple, in the same popup box.
    Do you want to move the selected movie to the Recycle Bin, or keep it in the iTunes Media Folder?
    Only files in the iTunes Media Folder will be moved to the Recycle Bin.
    [Cancel]  [Move to the Recycle Bin]  [Keep File]
    Is that the most confusing popup or what?  Who develops this kind of software?!?!?! 
    I have tried it both ways and the only difference is that the file shows up in the Recycle Bin or doesn't.  But in both cases the file name no longer shows in the movie list, so I don't know how to re-download it from the Cloud.  Better hey, if I clicked "Keep File", where is it?  I can't see it anywhere, so where is it kept and what can I actually do with it?
    I have to be honest, I love my iPhone and some of the neat features, but when it comes to iTunes, I have never seen a more difficult piece of software to use in my life... and I'm a software developer.  Your Support documentation is actually more confusing than the softwae itself, it's almost as if you don't want people to use the software, just simply buy stuff and listen/watch it, but nothing else.  Seriously, this is the most cumbersome, unfriendly piece of software I've ever seen.  What does it say about Apple iTunes when everyone has to google solutions for how to do something rather than using Apple support documentation.
    Seriously disappointed in Apple iTunes and it's never really gotten any better over time.  This is one of the primary reasons I have never moved all of my recording studios and office operations over to an Apple platform.  Hardware and phones are awesome, but your software is either grossly incompetent or intentionally designed to make it all but impossible to use.  Either way, it's worthless to me. We're talking about software that does nothing else but manage media that I already own on multiple devices.  That should be one of the simplest things in the world to do.  Sad... very sad.
    While we're at it.... why isn't iTunes listed on the product dropdown below?  Maybe it's not even considered a product, which would explain it's goofiness I guess.

    I own the movies and I want them to stay in my iTunes library basically forever.
    But in both cases the file name no longer shows in the movie list, so I don't know how to re-download it from the Cloud.
    iTunes prefs > Store > Show iTunes in the Cloud purchases.
    This will show all your iTunes purchases in your library with a cloud icon down arrow. Click the icon to redownload or click on Play to stream without downloading.
    Also see this , -> Download past purchases
    and techncially, you don't "own" the movie, You simply have a license to use it.
    Yet the first thing iTunes does when you hit the delete key is tell you that it will remove the movie forever from all devices and the library.
    Actually, no it does not tell you that.
    FYI: You should keep copies of all yoru iTnue spurahses as the labels/movie studios/copyright owners can pull their product at anytime and it won't be available to redownload.
    Suggestions here -> http://www.apple.com/feedback/

  • I have set up a override box for a simple calculation but it appears that it doesn't work in reader just pro.

    Here is what I have in the JavaScript Editor and it works when I use Adobe Acrobat Pro but when I download this pdf form to our extranet (which uses reader) I am unable to change the value when the override box is checked.  I have very limited knowledge of javaScript so any help would be greatly appreciated.
    In the SALE box I am trying to override I have:
    var g=this.getField("SELL");
    var f=this.getField("RATE_2");
    if(this.getField("override").value=="Off"){
    event.value=((g.value*f.value)/100);
    In the override box - mouse up run javascript I have:
    if(event.target.value=="Off"){
    this.getField("SALE").readonly=true;
    }else{
    this.getField("SALE").readonly=false;

    Are you sure you're using Adobe Reader? This code should work fine there.
    On Feb 24, 2015 12:04 AM, "christies3837445" <[email protected]>

  • TS1702 My iPad2 calendar app closes every time I turn the page to or select March 2013. I have followed shutdown procedures but still a problem. Can anyone help please?

    The Calendar app crashes when I select March 2013. I tried hard restart but app still crashes when March is selected.

    Look on april 1st. If you have any all day events, remove them. It's a glitch where all day events on APril 1 mess up March.
    Remove the event or edit it to span a few hours and March will reappear

  • I need to restore an external backup on my macbook pro but the "command R" function isn't working at startup. What do I do now?

    I've had a bunch of things replaced on my macbook pro, which meant that the hard drive was wiped. I did a full backup on an external hard-drive but now I can't restore it. Apparently I need to press Command and R upon startup (when the grey screen appears) but I've tried this numerous times and nothing happens. Any help would be g

    Try restarting holding the option key for the startup manager
    MacBook Pro (15-inch Mid 2012), OS X Mavericks (10.9.5), i7 500GB 16GB RAM iPhone5 iOS8.0.2

  • Flash Loads but "submit" or "continue" functions don't work.

    FP 10.1.82.76 installed ok. IE8 XP SP3.  Checked IE security settings are set correctly to "medium" and "scripting" allowed.  Checked AddOn settings also.
    When I go to websites such as http://files.hyfn.s3.amazonaws.com/skyy/go_natural.html I am allowed to fill in the form, but the submit button is dead.
    A similiar issue occurs at http://disney.go.com/partners/rockyourlunch/ (daughter is a JB fan, wants to enter contest!!!!!).  Site loads just fine and I am allowed to enter upc 7294570544 and then "click to enter".  The next screen that loads should be an account login, but the box just sits empty.
    I have also reset IE8 defaults and uninstalled/reinstalled FP.  Issue persists.  I also have FF and above pages are experiencing same problems.
    The account that I surf web from is a non-admin account for security purposes.  Have set to admin priv - still same issues.
    I do have a primary admin account - these pages work correctly for that user, but for the life of me I cannot pinpoint why FP won't work for this user. Possible registry settings??
    Thank you for any help.
    harrydoodlemom

    Sorry, not 'bumping" just thought of something -
    my "startup" process has been pretty thoroughly
    vetted by my teenager - perhaps something is missing or disabled for this account?
    thanks, harrydoodlemom

  • I bought a mac book air. when i use sony bluetooth headset on mac os, it works well, but on windows 7 it can't work in the device manager. why?

    i bought a mac book air. when i use sony bluetooth headset on mac os. it works well
    but with windows 7, device manager did not know the device.
    why?

    I disabled my microphone in Bootcamp Win7 Ultimate 64B and now it is completly gone. I used the Windows support CD I made and re-installed the 64B Cirrius drivers but the microphone is no where to be found also missing in device manager as well as Control Panel Audio.
    Help.

  • The searching function can't work in my itune app, but why? And how can I fix it?

    The searching function of iTune store doesn't work? How can I fix it??

    Hi,
    Try resetting your iPod:  http://support.apple.com/kb/HT1430. 
    Hope this helps! 
    ---likeabird---

  • How to call a PL/SQL procedure from a Java class?

    Hi,
    I am new to the E-BusinessSuite and I want to develop a Portal with Java Portlets which display and write data from some E-Business databases (e.g. Customer Relationship Management or Human Resource). These data have been defined in the TCA (Trading Community Architecture) data model. I can access this data with PL/SQL API's. The next problem is how to get the data in the Java class. So, how do you call a PL/SQL procedure from a Java program?
    Can anyone let me know how to solve that problem?
    Thanks in advance,
    Chang Si Chou

    Have a look at this example:
    final ApplicationModule am = panelBinding.getApplicationModule();
    try
         final CallableStatement stmt = ((DBTransaction)am.getTransaction()).
                                                                                         createCallableStatement("{? = call some_pck.some_function(?, ?)}", 10);
         stmt.registerOutParameter(1, OracleTypes.VARCHAR);
         stmt.setInt(2, ((oracle.jbo.domain.Number)key.getAttribute(0)).intValue());
         stmt.setString(3, "Test");
         stmt.execute();
         stmt.close();
         return stmt.getString(1);
    catch (Exception ex)
         panelBinding.reportException(ex);
         return null;
    }Hope This Helps

  • New to Java. Want to write a simple applet for a mobile phone.

    Hello,
    I want to write a simple java applet for a mobile phone. currently I am in the stage of thinking about whether this is possible in a timeframe of about a month. I have very little java experience from a while back so I'm pretty much starting from scratch.
    All I want is an applet that lets you send 2 or 3 variables to an online server. The server will then reposition telescopes.
    All i'm concerned with is the mobile phone part, which doesn't have to be secure or impressive. Just a simple interface.
    Ideally it should work on my nokia 6070, which occording to the official specs has the following java technology:
    MIDP 2.0
    CLDC 1.1
    JSR 120 Wireless Messaging API
    JSR 135 Mobile Media API
    Nokia UI API
    (I don't know what any of this means but am a good learner).
    Can anyone offer me any advice? Is this possible in my timeframe? where should I start? I need a editor and compiler also (I'm using windows XP).
    Many thanks and kind regards,
    Jason

    Actually it is working on my phone now.
    I changed the target platform in the wireless toolkit settings to MIDP 1.0
    Now to create the fields coordinate fields etc. I don't have much of a clue really.
    Current I have:
    import java.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class AtmosMIDlet extends MIDlet implements CommandListener
    Form WelcomeForm = new Form("AtmosMIDlet");
    StringItem WelcomeMes = new StringItem(null, "Please enter coordinates:");
    TextField Longitude = new TextField("Longitude", "", 3, TextField.NUMERIC);
    TextField Lattitude = new TextField("Lattitude", "", 3, TextField.NUMERIC);
    public AtmosMIDlet()
    try
    ImageItem logo = new ImageItem(Image.createImage("/logo.png"));
    WelcomeForm.append(logo);
    catch (java.io.IOException x)
    throw new RuntimeException ("Image not found");
    WelcomeForm.append(WelcomeMes);
    WelcomeForm.append(Longitude);
    WelcomeForm.append(Lattitude);
    WelcomeForm.addCommand(new Command("Exit", Command.EXIT, 0));
    WelcomeForm.setCommandListener(this);
    public void startApp()
    Display.getDisplay(this).setCurrent(WelcomeForm);
    public void pauseApp() {}
    public void destroyApp(boolean unconditional) {}
    public void commandAction(Command c, Displayable s)
    notifyDestroyed();
    I'm trying to get the image logo.png to display at the top but I get the error:
    C:\WTK25\apps\AtmosSpec\src\AtmosMIDlet.java:19: cannot find symbol
    symbol : constructor ImageItem(javax.microedition.lcdui.Image)
    location: class javax.microedition.lcdui.ImageItem
    ImageItem logo = new ImageItem(Image.createImage("/logo.png"));
    ^
    1 error
    com.sun.kvem.ktools.ExecutionException
    Build failed
    When I try to build.. Any help would be great.
    Ideally the image would be on a seperate screen for a couple of seconds.

  • Big question plz read slowly i need to write a procedure  but getting stuck

    please read this slowly........
    I have two tables content_attributes and RULES
    content_attributes with 3 columns and 9 rows as follows
    contentname contentattributes value
    logo category diagram
    logo class image
    apple category fruit-----------------------
    apple class red-------------------------
    apple entitlement diamond-----------------------
    computer class electronics
    computer category systems
    computer subclass chip
    computer entitlement machine
    RULES has these 3 rows and 6 columns
    rule_id rulename category class entitlement subclass
    1 r1 diagram image NULL NULL
    2 r2 fruit red diamond NULL
    3 r3 systems electronics machine chip
    I was asked to write a stored procedure...... on top of RULES table .it receives only one input parameter.They said my input parameter will be contentname (i.e it can be apple or logo or computer ) --
    NOTE : you can see contentnames in the first table above
    let us suppose if i get apple as the input to my procedure
    1)Ii should find what all attributes are there for the apple from the content_attributes table
    2) i come to know that category , class and entitlement are the attributes and its corresponding attributes it doesnt have subclass as attribute
    3) hence my query should be
    select * from rules
    where category=fruit
    and class =red
    and entitlement=diamond
    and subclass= NULL(since subclass is not present as attribute for apple it should be NULL but some other contentname may have this attribute value and other attributes null ) such as
    now lets run the procedure and give another input 'logo'
    if i receive input as logo then my query will be
    select * from rules
    where category= diagram
    and class=image
    and entitlement=NULL
    and subclass = NULL
    (entitlement and subclass are null because for the contentname logo these are not present as attributes in the content_attributes table)
    basically to explain in one line what i am doing is
    see the input.......... find the attributes in content_attributes table......... then use those attributes to query rules table...... the attributes that you dont find put them as NULL.

    You could be lazy and decoded your where clauses...
    -- All tables where there are 6 rows
    select *
    from user_tables
    where decode(num_rows, 6, 1, 0) = 1;
    -- All tables where rownum is null
    select *
    from user_tables
    where decode(num_rows, null, 1, 0) = 1;OR you could could do it the long way and make your where clause more specific...
    WHERE (PARAM = COL_VAL OR (PARAM IS NULL and COL_VAL IS NULL))

  • Why item level validation can only execute function but not procedure?

    Dear all,
    When execute my form, some parameter values will be passed to the text items.
    Those values are the procedure name or function name for that particular item which are already defined in a package and those items are non-database items.
    Suppose a particular item can be validated by a procedure or function. It depends on what value is passed into the program.
    If the item when-item-validation is triggered, that corresponding procedure or function will be executed by calling the following codes A) or B):
    A) EXECUTE IMMEDIATE 'BEGIN' || procedure || '(:1);END;' USING v_value;
    OR B) DBMS_SQL.EXECUTE(...)
    Basically, the form is working fine except 2 blocks which can only accept Function, i.e. only fired the function but cannot fire the procedure. Actually these 2 blocks are similar to the others blocks and they are also non-database blocks.
    I am using Form10g.
    Anyone have idea for that? Thanks for advance.
    Regards.

    You cannot use Execute Immediate in Forms. You have to do that on the server in a stored procedure.
    You should not use DBMS_SQL either. In Forms, you use EXEC_SQL, which is almost the same, except for the error handling. And it is VERY slow, since you make a number of calls to it, plus one for each variable passed.
    Now... if you call a function, it must return a value. If you write code to dynamically call a function, this process must be complex enough to handle the returned value. The same occurs if your procedure that you call has any parameters. If there are no parameters, then it would be simpler.
    If you want dynamic function or procedure processing, then I would suggest you just pass the value being validated plus the table.column name to a server-side stored procedure or package, and do all the processing on the server.
    Good luck... it won't be easy.

  • A simple question but difficute for me

    I'm trying to write a simple java applet that is able to repond actions from "mouse" and "key board". But surprisingly, it can only repond actions from "mouse". I know that the functions "KeyDown" and "MouseDown" are depreicated methods, but they should still work though. If "MouseDown" can work, why "keyDown" is not working?
    import java.awt.*;
    import java.applet.Applet;
    public class Key extends Applet {
    public void paint(Graphics g){
    g.drawString("Hello", 50, 50);
    public boolean keyDown (Event e, int key){
    System.out.println("key down");
    return true;
    public boolean mouseDown (Event e, int x, int y){
    System.out.println("mouse pressed");
    return true;
    }

    then you need ActionListener
    for example
    addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            jButton1_actionPerformed(e);
        });

Maybe you are looking for