'ALTER SESSION SET CURRENT_SCHEMA' does not work

Hello

in my JAVA application, I need to change a user's session so that it gets access to the tables that are created by the user 'myUser' (see code below).

The code below shows how I tried to implement with JAVA:

---------------------------------------------------------------------------------------------------------
Statement stmtSchema = con.createStatement ();
String sql = "ALTER SESSION SET CURRENT_SCHEMA = myUser;"
check int = stmtSchema.executeUpdate (sql);
---------------------------------------------------------------------------------------------------------

There is no exception later when running the program, but it seems that the SQL in JAVA command will have no effect because when the program tries a SELECT statement after the session I get an exception:

Java.Sql.SqlException ora-00942: table or view does not exist

This means that the current_schema has not yet changed.

When I tried the same command with sqlplus, it works fine.

Why it does not work with JDBC?

We use 8.1.3 of Oracle and Oracle 10g Release 2.

Hello
just a validation test. You guarantee that the alter session command and the select statement is belonging to the same connection object?
If the connection object is the same you can post a simple test cases for further investigation?
Ciao,.
Giovanni

Tags: Java

Similar Questions

  • ALTER session set current_schema

    Hello

    We have multiple instances of the database (for example, MR01DEP, MR02DEP,...).

    Each instance is composed of more than stores (called schemas): for example, for MR01DEP, we have STORE1, Bank 2, 3, to MR02DEP we STORE5, STORE6,... and so on.

    Now, using developer PL/SQL, SQL Developer or even SQL Plus, when I connect to these databases, I connect using the user SUP_TMP (who has the privileges necessary for the actions that I have to do), and I have something like this:

    Conn SUP_TMP / < password > @STORE1 (I can connect like this and not with @MR01DEP; However, even @MR01DEP is correct).

    Today, all the tables are on these patterns (STORE1, STORE2,..), and when I connect with the SUP_TMP user, each time, at each meeting, I have to write:

    ALTER session set current_schema = STORE1, or

    ALTER session set current_schema = Bank 1

    At the beginning of every script that I have to run, I want to write a little routine so that I don't need every time to this «alter session set current_schema» statement

    If I connect with SUP_TMP / < password > @STORE1.

    so I see in the instance of v$, as the instance_name is (correct) MR01DEP.

    But I need to somehow get that banks '1', which I use when I connect to it (although, normally, I connect to a database, such as MR01DEP, but I'm specifying STORE1 in the connection string).

    So, in other words, I need that at the beginning of each script, to determine the current connection string I'm specifying after '@', and which is the current_schema.

    If I log in as SUP_TMP / < password > @STORE5, then I'll have something like immediate execution "alter session set current_schema = STORE5'."

    SUP_TMP user should be the I connect each time, but the current pattern of each script in each session, must come from the connection string.

    Is this possible?

    Thank you!

    I know, I specify the store, and it will automatically connect to the correct database (this is the case).

    No - NOT sure that connect you to the right base.

    As said ground that alias 'keep' is on the client and can be mapped to ANY DATABASE at all.

    Also - what you specify with is the DATABASE - this isn't a pattern.

    You're talking about two different things.

    You set the current schema - you connect to a database. TWO DIFFERENT THINGS.

    It may not even be a schema with the same name as the database.

    Do not use the same name for the databases and schemas. Oracle is NOT sql server.

    You can create a trigger AFTER the opening of SESSION to define the schema for you, but you must be able to know which schema must be defined.

  • Open a session on Windows does not work.

    I have an old computer in the company of my old job that I wanted to use since I was allowed to keep the computer. The computer is configured with the domain s network under the name of the company. I was stupid enough to try to change it so it did not run under the domain of computer network (do not know why I had to play with him?). The computer asked me to restart the compuuter for the changes to take effect. Yes, I did. But now, when I Ctrl-Alt-Delete in the Welcome to Windows dialog box, it opens a new dialog box who want a username and password to get into the office. I tried to enter the old user name and password, and the new name of user and password I thought I had given, but now, the computer does not work. It is basically useless. The only options I have is to stop or cancel and no way brings me anywhere. Any help anyone? Please? Thank you

    http://support.Microsoft.com/default.aspx/KB/940765/en-us

    How to use system restore to log on Windows 7 or Windows Vista when you lose access to an account

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    http://support.Microsoft.com/default.aspx/KB/189126

    "Microsoft's strategy concerning lost or forgotten passwords"

    Microsoft cannot help you recover the passwords of the files and Microsoft who are lost or forgotten product features.

    http://social.answers.Microsoft.com/forums/en-us/vistasecurity/thread/3eba3150-8742-4264-be9f-0daaad2282cd

    Read theBANNING of cracking of passwords information tools information provided in these forums in the thread above posted byBill fill MSFT, moderator

    See you soon.

    Mick Murphy - Microsoft partner

  • Original image has disappeared I think off the hard drive and the BIOS password set up does not work?

    Someone please help me with this!

    I bought this laptop from a friend (have receipt) who sell it to me because the screen was cracked and spidered all out when you the activated. And everywhere he went to ask to get the screen fixed it is very expensive ($250 - $350) and he said that it would be just a newer laptop. So he sold me this which is a model Probook of HP4420s XT940UT #ABA. About a week after I bought this Probook friend who sold it to died me suddenly. It was sudden and terrible. Some time later, I had the time of the purchase of the LCD for this model, replace it myself (was very easy actually) and booted up the laptop with a new installation of Windows 7 Professional 64-bit Edition. After installing all my software and using the laptop for a while now, I wanted to get into the Bios that I've never done. So when I started the laptop, click ESC, then F10 to enter the BIOS, there were two places to enter a password is different then all Dell I've ever owned. One was mine I guees I put in place using HP protect tools and the other says BIOS/administrator. Well I can do most of the changes with the one I put in place with my password but my password does not work, nor can I get in some very significant changes that I wanted to do using Bios/administrator, as kindling the LoJack, namely the blocking of the hard drive etc. , turning on turbo boost, fan, etc. Well, since the person I bought is no longer with us, there is no one to turn to the answer to this question of administrator/BIOS password / problem.  I tried to take battery Rtype and restore that way, didn't work. Several times, I called HP and they sent me to a BIOS page to download the same BIOS, I have already, would not let me install it. When I bring up the command prompt and do not put anything in BiosConfigureUtility.exe happens, said just a wrong command. When I try to enter the BIOS through the C: file in the files of the SSM, I reach the BiosConfigUtility.exe file, click on it to open it and it just flashes a way small order page to fast to read what it says. I would like to have complete control over my laptop thinking I have a lot of time and money invested in it now. The problem would have something to do with installing the 64 bit version of Windows 7 instead of the 32 bits guess what it initially provided with?  Where can I find the UUID and what tech Department I would ask because if I have to call HP again and what other information should I have ready for them if you know? I have all the manuals and they say that this laptop is compatible with Windows 7 Ultimate 64 bit Pro is what I installed. I'm mixed responses from many different people on this and would like an answer from HP someone who has experience in dealing with the BIOS in the Probooks business models if possible please. I really like this Probook and have since become a big fan of most HP, Dell and Lenovo.  I intend to buy two probooks, one for my wife and one for my daughter because this one is like a MacBook, but better.  Thank you for reading this and I hope someone can help with more than one answer then GET AHOLD OF HP TECHNICAL TEAM. As I said, I did it.

    Model: HP Probook 4420 s

    Type: XT940UT #ABA

    Operating system: Windows 7 Ultimate

    BIOS version: 68AHHH Ver.F.20

    SM BIOS Version: 2.6

    Hardware Extraction layer: Version 6.1.7601.17514

    Jason,

    Sorry to hear about your friend and your problem.  The BIOS password cannot be reset without the help of HP.  They will need some information from your PC and increase your case.  I recommend you give them a call.

    -wes

  • Adobe first CC 2015 - Set Matte does not work correctly

    Validated during the Adobe Creative Jam in Las Vegas that this feature does not work in the latest version of Adobe first CC 2015.  We should be able to put a cache based on any channel (alpha, lum, etc.) target a video layer.  It worked correctly in previous versions.  It would be the same process in After Effects to the current layer to follow matte (alpha, luma, etc.) the top layer.

    Please advise when this will be fixed.  This affects several tasks frequently performed in publishing as creating custom transitions, title effects and more.  Probably will be considered a serious bug.

    Maybe this has been posted in the wrong place then.  Thanks for the comments.

    It looks like to be corrected during the 9.2.0 (41) generation applied this morning.  Ran tests and it works as it is supposed here.

  • Set linesize does not work in sqlplus

    I am trying to use sqlplus to empty a few DOF for a stored procedure. I found a problem with my script where it isn't properly unload the lines in a file, and this seems to be caused by problems with the 'set linesize' command in sqlplus. Lines are getting truncated to 80 characters, no matter what I set the linesize variable to (currently I changed it to 500 as test - but it still doesn't work)!

    For example, I have a line in the procedure as follows:



    CREATE OR REPLACE PROCEDURE
    ...
    INSERT INTO SOME_TABLE_NAME_HERE (OWNER, ACTIVITY, ACTIVITY_COST, NUM_WORKERS, NULL)
    SELECT...


    I can see that the 80th character is the "NULL" and "ULL" is beyond the limit in SQL Developer. When I empty the DDL in sqlplus, it appears like this, no matter what I set linesize to:



    CREATE OR REPLACE PROCEDURE
    ...
    INSERT INTO SOME_TABLE_NAME_HERE (OWNER, ACTIVITY, ACTIVITY_COST, NUM_WORKERS, N
    ULL)
    SELECT...



    Here are the options I use in their entirety. This is an excerpt from a shell script that I'm trying, but you can see the options that echoes in the file that is ultimately read / performed by sqlplus:

    echo "set position off;" > > proc.sql
    echo "set echo off;" > > proc.sql
    echo "value 999 pages;" > > proc.sql
    echo "set off termout;" > > proc.sql
    echo 'long set 90000'; > > proc.sql
    echo ' set linesize 200; "> > proc.sql
    echo "${schema} .txt reel" > > proc.sql
    echo "select dbms_metadata.get_ddl ('PROCEDURE'," ${proc} ") from dual;" > > proc.sql


    No matter what I set linesize she always truncates to the 80th character and begins printing on the next line. Change the linesize option seems only right key to exit with spaces. So if the line is longer than 80 characters and I set linesize to 90, it truncates the 80th character, impression 10 places and then print 'LLD') and 86 seats on the next line. If I change to 100 then I get 20 seats on the first line, followed by "ULL") and 96 places on the next line. And so on...


    I tried to use trimspool ON but it does not help the issue. Set linesize seems to be useless - everything is truncated to 80 characters. What I'm doing wrong here? Thank you!

    Hi and welcome to the forum,

    Looks like you need the LONGCHUNKSIZE of the VALUE

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14357/ch12040.htm#SQPUG089

    Concerning
    Peter

  • Rename the session restore backup does not work, how can I restore previous session after a crash?

    Computer crashed and Firefox don't remember my session. It happened a few weeks ago while I had looked at how to fix and I learned from my mistake and saved the sessionstore.bak file before restarting Firefox. I closed Firefox, deleted sessionstore.js and renamed .bak to js but to start what it does not always restore session. Previous restoration on the history tab still grayed out, about: sessionrestore revealed without tab. I even tried to copy this file and also naming copies as sessionstore-1 & 2. How to operate?

    You can try to restore a previous version of the file sessionstore.js or sessionstore.bak. You must rename the .bak to .js file to make Firefox see this session.

       right-click: Properties > Previous Versions
    
       http://windows.microsoft.com/en-US/windows7/Previous-versions-of-files-frequently-asked-questions
    
       http://kb.mozillazine.org/sessionstore.js
       http://kb.mozillazine.org/Session_Restore
    
       https://support.mozilla.org/kb/restore-previous-session
    
  • setting permissions does not work

    We have created the Contactlists through the API Rest Eloqua. When creating, we pass value of permissions fullcontrol, reading and writing, but in response, shows the State of authorization FullControl.

    List of contacts is created with fullcontrol authorization even if that it is created with read or write access.

    Permissions on assets property is read-only and contains the effective permissions of the current user to the asset.  The default configuration for asset permissions give the user creating a total control of assets they create, that is why it is said that your username has total control of the new fixed asset.

  • Session manager does not work

    I don't know if this goes in the tabs section or the section modules, so I placed it here in tabs.

    I label mix more and that's what happened to me recently:

    I just started firefox; He asked me to restore the tabs and I said 'yes', but all tabs are empty. I thought it was a mistake, then I closed Firefox and restarted and now the sessions don't ask me if I want to restore the previous session. After playing with it, I've broken down and started a new session. Got the essential and other elements, closed firefox and he asked me if I want to save, and I said 'yes '. When I went to open firefox, nothing happened. He didn't ask me to restore the session or anything like that. I checked the session manager and sessions before that I just do (sessions that were there when the bug happened) were there and the session manager still does not work.

    Thanks for your help.

    You can use updates made to TabMix Plus in the tab of the Add-ons Manager, using the context menu.

    Also, TabMix Plus has its ' own support here forum.
    http://tmp.garyr.NET/forum/

  • Thumbnail option does not work in Terminal Server in Windows Server 2012 and server session

    This might be a stupid question.

    We have two Windows server 2012 R2 - TS and DC. The clients are connecting to TS and access the shared network drives present in DC. I always unchecked 'show icons, never thumbnails' and 'Show thumbnails in System Properties' enabled on DC and the two TS.

    No always thumbnail option.

    You will need to click on each image. Users have many files containing multiple images. It's annoying to click and view each image.

    Note: NO GPO is configured to block it. Checked.

    I can't find any object GPO to allow this option to be :)

    More info. For customers, anywhere, whether network shares or all folders in TS session. It does not work. Also tried painting and Windows Photo Viewer.

    Here, any help will be very appreciated!

    Hello

    Post your question in the TechNet Server Forums, as your question kindly is beyond the scope of these Forums.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    See you soon.

  • VAIO F Series 3d - Blue Ray 3d does not work

    Hello

    I just got the laptop Vaio Fseries 3D and when I tried to play Blue Ray 3d Disney's "Tangled". corel DVD player - the image is pixelated and the noise we very nervous. I tried to adjust the parameters of performance and 3d setting, but does not work.

    Does anyone else have this problem? Help, please!


  • still, mail. Identity.default.suppress_signature_separator set to True does not work, is their a new patch?

    I still have the '-' applied above the signature even after applying the fix to mail.identity.default.suppress_signature_separator that is set to true. Have tried running Thunderbird in safe mode, always have the same question. Have restart the computer several times, always have the same question. Reading a lot of messages on it, but don't say that it does not work even after you apply the hotfix does not. All of the suggestions. Pure install any extensions or add-in.
    User Agent Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

    The fixed. completely removed Thunderbird, user and folder programming created by thunderbird profiles. Deleted file folder in windows. Rebooted PC. Installed Thunderbird. Add an account. Went to change only the settings in the config to remove the signature separator. He then worked.

  • Flash does not work in FF26, it works in Chrome and IE. I reinstalled FF and Flash several times. I can't adjust the setting of local storage for Flash either.

    Flash does not work on some web sites. I never had a problem before with flash on FF in the nearly 15 years that I've used FF. Recently it has stopped working for some reason any and on some flash sites does not, NHL.com and site of kid Herotopia being just two of them. I updated FF, Adobe flash, the reinstalled version them repeatedly deleted all the files that have been stored on my laptop; that is, profiles, saved favorite nothing that I could find in user accounts and in the local app, low local and roaming data folders. What is strange, is that I can't set the local storage for flash either. When I visit the Adobe site to view the Adobe Flash Player Settings Manager I can move the scroll bar, but cannot check the: allow third-party flash content to store data on your computer. I can't do it on a Web site where the flash does not work. When I try and it changed on any site that it goes back to zero. Not sure if it is a part of the problem. I got tired of many suggestions on the pages of material here, but nothing works. I even tried this http://forums.adobe.com/message/4566499#4566499#4566499

    The other strange thing is that I used to get the "warning: script does not" prompt that displays "a script on this page may be busy, or it may have stopped responding." You can stop the script now, or you can continue to see if the script ends. "sometimes when I would buy on Macy's.com. This is the only site that it happened.
    I know I have only little technical knowledge, but I have tried to figure this out for a few days and do not know what is happening. The only thing I can think is that I somewhere files corrupted causing this problem. I have just updated to Windows 8.1 tonight in the hope that can help, but nothing helped. I would be very disappointing if I couldn't use FF or must go back using Chrome and FF.
    Sorry for the posting long but no solution would be much appreciated.

    Hi jscher2000,.

    Yes, I followed essentially the: Manual steps: https://support.mozilla.org/en-US/questions/968190?page=5#answer-509209 you have posted.

    And after restarting Firefox, Flash worked. Thanks again for your post I could not find this solution on the Adobe forums until you have posted the link.
    Your expertise and your time is much appreciated.

  • Unable to restore the previous session. Your info page does not work.

    Follow instructions on your info/help page and also tab 'options' under 'tools', that says restore previous session - but does not work.

    Session restore

  • "set the restart target action" does not work, why?

    There is an element of "set the restart target action" in the SDF file. I put it to "run a system definition.

    But it does not work. I don't know why. It seems that when the project is canceled, the SystemDefinitionData.nivscfg file is deleted.

    Cancel the deployment of will stop the configuration and mark idle.

    If you restart the RT target by HW button or through the channel "System of command channels", while the configuration is active, it will start the Setup again after the reboot.

    Jiri K.

Maybe you are looking for

  • No problem updating iPhone to iOS 10 6s?

    How to find your version of iOS 10 has been downloaded on my iPhone?

  • When I try to open an attachment I "Download cannot be saved, because an unknown error occurred."

    Title says it all. If I try "to open" an attachment, the download dialog appears, and the progress bar begins to fill, then it should be full I get the message: "The download cannot be saved because an unknown error occurred Please Try Again. » I can

  • Why Firefox does not open?

    When I click to open Firefox, nothing happens right away. After a period of time, I get a box that pops up saying Firefox crashed. I filled the news and sent the report to Firefox, repeatedly. I tried several things on troubleshooting and still not g

  • Recovery work do not

    After getting a virus on my girlfriends laptop which caused this crash she used the windows vista recovery disc Home premium product to try and restore the laptop back to factory settings, however a short while in the restart of a warning sign appear

  • Wifi on HP Pavilion Sleekbook 15 commectivity limited problem

    Hello I have problems with my Wifi on my HP Pavilion Sleekbook 15 (product number: D2H26EA-#ABD)I've updated Windows 8 to 8.1 Windows as well as assistance such as Qualcomm Atheros QCA9000 series Wireless LAN Driver for Microsoft Windows by the sugge