How can I reuse the BC4J database connection?

How can I reuse the BC4J database connection?
I want to use the application module connection without opening another in a custom code. At this level I can’t access de ADF code, that’s why I can’t get the DBConnection from the application module.
Now, I have a “data-sources.xml” in my project and the application module is configured to access the database from this xml file.

I found the solution in other Forum. I worked ok.
Here the code:
If the Connections-Navigator connection is DBConnection1, the corresponding datasource is jdbc/DBConnection1DS.
1. Create a JSP page.
2. In the web.xml of the JSP add
<resource-ref>
<res-ref-name>jdbc/DBConnection1DS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
3. In the JSP page obtain a connection with the datasource.
InitialContext initialContext = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource)initialContext.lookup("java:comp/env/jdbc/DBConnection1DS");
java.sql.Connection conn = ds.getConnection();

Similar Messages

  • How can I get the ipad to connect to itunes 10.6.3?

    How can I get the ipad to connect to itunes 10.6.3?

    The iPad mini requires iTunes 10.7 or newer to sync.
    (82182)

  • How can I tell the device is connected to itunes 12?

    how can I tell the device is connected to itunes 12?  I have Windows 8.  I hear that the device is connected, but don't see the device to manage.  Only thing that happens is on the phone it says Trust the computer..   I say Trust and nothing happens.

    in ituens at the top where you see the small icons for Music, Movies, TV etc when your device is connected you will see a small icon representing your phone or ipad etc popup click that and it will show you the usual interface for backup and syncing.
    if that doesnt happen, like it didint for me initially, you should close itunes fully via task manager if you know how to do this and start it again with the device unplugged then plug it in after itunes has finished loading.
    Worst case scenario you nee to resatrt

  • NetBean, I can't establish the oracle database connection with version 9i.

    In NetBean, I can't establish the oracle database connection with version 9i.
    I have create the datasource and it is fine.
    when i try to access the tables i get a message
    "Unable to refresh children, connection is broken, unsupported feature"
    in netbeans.
    Does netbeans support oracle 9i version.
    Thanks,
    VKK

    In NetBean, I can't establish the oracle database connection with version 9i.
    I have create the datasource and it is fine.
    when i try to access the tables i get a message
    "Unable to refresh children, connection is broken, unsupported feature"
    in netbeans.
    Does netbeans support oracle 9i version.
    Thanks,
    VKK

  • How can I move the distribution database to a new server?

    I need to migrate an old distribution database to a new VM. My understanding is that you can detach/attach the distribution DB to make this easier. What are the 'gotchas' in this process? Do I need the detach/attach the system databases as well? The distributor
    is facilitating data from Oracle to SQL Server.
    Another question.. what are some good benchmarks for figuring out how much horsepower I should have set up in my VM that running distribution?
    Thanks,
    phil

    Hi philliptackett77,
    As your description, you want to migrate the distribution database to a new server. Based on my research, you need to remove the replication,  create the distribution on the new server, and recreate publication and subscription according to Satish's post.
    So you don’t need to detach or attach the distribution database or system databases.
    To make this process simple, you could use SQL Server Management Studio (SSMS) to generate scripts and run the scripts to recreate publications and subscriptions or drop publications and subscriptions as the screenshot below. Checking ‘To create or enable the
    components’ generates the script for creating the publications and subscriptions, and Checking ‘To drop or disable the components’ generates the script for dropping the publications and subscriptions.
    Firstly, please use SSMS to generate the script which is used to create publications and subscriptions.
    1.Connect to Publisher, or Subscriber in SSMS, and then expand the server node.
    2.Right-click the Replication folder, and then click Generate Scripts.
    3.In the Generate SQL Script dialog box, check ‘To create or enable the components’.
    4.Click Script to File.
    5.Enter a file name in the Script File Location dialog box, and then click Save. A status message is displayed.
    6.Click OK, and then click Close. For more information about the process, please refer to the article:
    http://msdn.microsoft.com/en-us/library/ms152483.aspx
    Secondly, follow the steps above, check ‘To drop or disable the components’ to generate the script used to drop publications and subscriptions. Then run the sript to drop publications and subscriptions.
    Thirdly, please disable distribution using Transact-SQL or SSMS following the steps in the article:
    http://technet.microsoft.com/en-us/library/ms152757(v=sql.105).aspx.
    Fourthly, please create the distribution at the new server using Transact-SQL or SSMS following the steps in the article:
    http://msdn.microsoft.com/en-us/library/ms151192.aspx#TsqlProcedure.
    Last, please run the script generated in the first step to recreate publications and subscriptions.
    Regards,
    Michelle Li

  • How can i decide the position of "connection.properties"

    hello
    i am a beginner of sqlj,and download a sample code from the oracle website,i find that the sqlj file need to read a "connection.properties" file,that define the database connection information,this file is put in the same directory as the sqlj file (i mean that they are within the same subpackage),i debug it by using the jdeveloper,it works well,but if i move the "connection.properties" file to the parent package,it don't work.and i can't find any config file that is used to define the position of the "connection.properties" file.i wonder whether i must put the "connection.properties" file and the sqlj file within the same package?if yes,consider following scenario:
    if i have several sqlj files,and they are within the different package,all of them connect to the same database,must i copy the same "connection.properties" to every package that the sqlj file reside on?
    thank you!

    with HTML of course!
    if you want it in the center... do <center> appletcode </center>
    if you want it in the bottom right corner use tables to move it there.

  • How can we clone the Oracle database in new Oracle Home

    Hi,
    I would like to clone oracle database into new oracle home. How can we set it using OEM.
    I am using 10g grid control. Target db is on solaris
    Thanks
    Naveen

    after logging into target database, under maintenance tab, data movement header; ther is "clone database" option. When you click on it; you'll see :
    Clone Database uses RMAN to duplicate a database from:
    -- An open database in ARCHIVELOG mode, or
    -- An open database in NOARCHIVELOG mode (restart required), or
    -- A saved working directory from previous cloning
    Clone Database performs the following operations:
    -- Backup each database file and store it in a working directory
    -- Transfer each backup file from source to destination host
    -- Restore each backup file to existing destination Oracle Home
    -- Recover the cloned database with saved archived log files
    -- Open the cloned database with resetlogs
    It seems to be for cloning to a different host, but i guess you can chose the same host for source and destination. (I've never used cloning on em by the way :))
    But firstly, you should create a new oracle home, you can simply copy your oracle home with a new name (cp -R /oracle/app/oracle/product/10.2.0 /oracle/app/oracle/product/10.2.0.new) or make a new installation.
    I suggest you to do this cloning with CLI. You should take a full backup with RMAN, copy the oracle home, create a new initNEWSID.ora file and nomount the database, restore (or simply copy) controlfiles, restore database (with set newname commands), recover database, open resetlogs.

  • How can i know the no .of  connections are used in the connection pool

    Hi
    I am using tomcat connection pool in my project .but how can i know how many connections are used by my project .how can i know how many connections are used plez help me

    You mean INSIDE the webapp, using the Admin Console (tomcat docs should be helpful in that case)... Where are you supposed to search for the info?

  • How can I remove the JDBC (JDNI) Connection Information prompt?

    Hi everyone,
    I'm using Crystal Reports 2008 and a JDBC connector to a MySQL database.
    My reports work well, but I'm always prompted to enter the database password in the JDBC (JDNI) Connection Information window prompt. The other fields (server, database, user ID) are automatically populated, but I have to enter the password.
    Is there anyway for me to bypass this prompt altogether? Or, can I manually hard code the database password somewhere?
    Thank you!

    Hi Rachel,
    You can't get around this unless the driver supports Trusted Authentication which uses the local user log on credentials. It's just the way it works. Crystal will not and never has saved the database password and never will. This would be a major security issue. Anyone could get your report and have full access to the DB.
    Thank you
    Don

  • How can i reuse my existing socket connection

    Hi,
    this might sound basic, it probably is:
    As part of my larger project, i have to send and recieve data to multiple socket connections.
    The thing that happens is that everytime i send data, it seems that java is creating a new stream or something (code is multithreaded)
    so as i send 4 items of data, a bit like a chat program sending 4 statements, it creates 4 different streams, instead of using the same stream. therefore when i close the connection, i get:
    java.net.SocketException: Connection reset 4 times.
    i know why.. its because i have added the:
    Socket socket=new Socket(host, port);
    BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    PrintWriter out = new PrintWriter(new OutputStreamWriter(socket.getOutputStream()));
    bit in the same method with the
    out.println(THE DATA....);
    out.flush();
    The thing what i want to do is to create the connection one, and reuse the objects:
    out, in and socket
    to send / recieve the new data.
    please help me guys,
    thanks

    All the threads would be able to get the same reference to....
    class SocketWrapper {
         private final Object readLock = new Object();
         private final Object writeLock = new Object();
         // client side
        public SocketWrapper(String hostname, int port);
         // server side.
        public SocketWrapper(Socket);
         // send data
         public void send(Serializable object) throws IOException;
         // receive data. synchronized(writeLock);
         public Serializable getNext() throws IOException;
         // create a new socket as required, throw IllegalState if server side. synchronized(readLock)
         private void createNewSocket() throws IllegalStateException;
    }The send autoconnects as required. It then send on message/packet/object.
    The getNext autoconnects as required. It reads one message/packet/object and returns.
    This allows multiple threads to access the same socket. It allows data to be sent while a thread is blocking on a read. (Thus two locks)

  • I am unable to connect my PC to my Mac using the Migration Assistant.  The two computers do not seem to connect and I am not sure on how to do so.  I'm using an Ethernet cable and neither computer recognizes the other.  How can I get the two to connect?

    The PC keeps saying "Waiting for your Mac to Connect" and the Mac keeps saying "Looking for Computer"  I have no clue what to do.

    I suspect you didn't follow the Migration Assistant instructions. Please carefully look over:
    http://support.apple.com/kb/HT4796?viewlocale=en_US
    If you still cannot get it give AppleCare a call, the number is in your owner's manual. You have 90 days of free telephone support when you purchase a new Mac. They can assist on the OS X side but remember they may not speak MS Windows.

  • How can I update the QuickLook database?

    About 10 days ago my dock in Leopard crashed and I could not find it without restarting. Now I see in the console at startup:
    Dock[150] [QL ERROR] Generator database update takes too long... we will use what we currently have
    Since I have updated the Info.plist on my .tex files to conform to public.plain-text I would like quicklook to take note of it, but nothing I do will force it to take effect. On the command line qlmanage -r shows "resetting all generators" but qlmanage -m ends with the statement "generators change detected: NO". Any help would be greatly appreciated. Thanks

    This is by no means a complete answer. I still get the error messages in the console. However, I now have a partial answer to my question. After I log in, I run Cocktail 4.0.1 for Leopard, Select System then Databases. Then Rebuild Launch Services database with Restore default file associations enabled. About three quarters of the way through executing /System/Library/ScriptingAdditions/StandardAdditions.osax/Contents/MacOS/uid the .tex files lose the icon when selected, show the label "TEX" and can now be viewed with a touch of the space bar. What a pleasure. To the poster who recommends staying with Tiger, I say I never want to give up the pleasure of having Quick Look a spacebar away for all my files.
    Unfortunately, when I logout, restart or shutdown, once again, none of the org.tug.tex files are registered as public.plain-text and only the icon appears. To regain Quick Look capability I have to Rebuild Launch Services database. It only takes a few minutes, but I would like to automate the process somehow at login, but I have no idea how to do this. I will probably stay logged in for long periods of time, hoping that an update in the future will resolve this.

  • LabView 7.1 SIT: how can I modify the LV-Simulink connections during execution?

    Hi!
    I'm using LabView 7.1 (with the SIT toolkit) to make a user interface for a
    Simulink model.  The problem I’m encountering is that the Simulink
    parameters aren’t always linked to the same LV controls, depending on the options
    selected by the user.  Since I wasn’t sure
    if it was possible to do this, I decided to send the values of the main
    controls into other controls, which would be hidden (or not if I can’t… doesn’t
    really matter).  The hidden controls would
    then be linked to the Simulink parameters, and the connections would never have
    to change. 
    It is quite
    confusing to describe in words, so I’ve included a picture representing what I’m
    trying to do.  It shows the way I'm trying to do it right now, with the hidden controls, but only the final result counts, so tell me if there's a better way to do it, or if it's just wrong.
    For the moment, since
    I’m not very good at using events, I just can’t figure how to connect the
    hidden controls to the Simulink parameters. 
    By default in SIT, the Simulink values are updated when the user changes
    the value corresponding LabView control. 
    Here, the values of the controls linked to Simulink are not modified
    directly by the user, so it doesn’t update.
    I hope my explanations are clear enough to be understood… if not, don’t hesitate to ask more details.
    Thanks in advance!

    I just tried to do what is shown in your picture, and it does update the value of the control, but the value is not sent to Simulink... I don't know if I'm doing something wrong...  I did some basic tests with the Sine Wave SIT example.  I added a control called "Frequency Simulink", which is updating each time the value of the "Frequency" control changes, using a local variable inside the event (like your picture).  However, the new value of the frequency isn't passed to Simulink.  I posted the modified version of the sine wave example that I used to test, if someone wants to try it.
    Thanks for your answer, and please tell me if I did something wrong.
    Attachments:
    SITtest.vi ‏273 KB

  • How can I have the external HD connected to my Airport Extreme show up on Windows 7 and 8.1?

    So, I have an Airport Extreme which works flawlessly.  I have a 1 TB external HD connected to it.  On my Maccbook Pro and a windows 7 laptop, I can view the HD as "Z".  For some reason, on another Windows 7 and Windows 8.1 Laptop, it is not showing up under my computer.  Any advice?  THANKS!!

    You can share files with iOS devices by using filebrowser or other file app.
    To play movies on the iOS device though you would need a player that is outside of itunes.. because itunes will not play from the router.. it has no media extensions.. neither does the TC which merely adds an internal disk but is otherwise identical.
    So look up how to play movies with a player on the iOS.. there is several available I am sure.
    http://www.pcadvisor.co.uk/how-to/apple/3512138/how-put-films-on-ipad/
    BUT itunes depends on a computer running in the network.. so storing the itunes library on the AE is useless.. and will slow the network down no end. It is much better to put files where they can be accessed.. ie directly on the computer.

  • How can I rebuild the iPhoto database?

    Twice I have received message about my thumbnails and permissions needed to be worked on.  The first time the "Genius" did a "rebuild" and that worked for a while.  How do I do a rebuild?

    The format is the drive - to have the iphoto library on it it must be Mac OS extended (journaled) - in the finder fight click on the drive and get info - the info window gives the format
    And please explain the two new variables you just introduces without giving a single answer to  my preious questions
    it has a very poor connector.
    I have copied all photo's back to the MAC hard drive.
    and please answer
    What version of iPhoto? Is OS X 10.6.3 as you state correct?
    Remember we can not see you nor read your mind - I ask three questions - you have not answer a single one yet - without answers it is not possible to help
    LN

Maybe you are looking for

  • Making a DVD from Keynote

    This should be a simple process, but I can't find out how to do it. (I get it to work after hours of trial and error, usually, but this time I'm stuck) I make a Keynote show - beautiful photos, text, etc - but without the music since I've been told t

  • Compressor 3.0.5 not working in Yosemite.  Fixes?

    Compressor 3.0.5. does not work in Yosemite 10.10.1.  I receive an "Unable to submit to queue.  Please restart your computer or verify your Compressor installation is correct." error message. I'm also currently unable to download the newest version o

  • Arabic text(font) in report 11g

    Hi, I am converting 6i reports to 11g where I am using "Arabic Transparent" as font but in 11g it is not coming, I want to know how to configure Arabic fonts in 11g reports

  • Where are the Color Matching buttons for Speed Grade CS6?

    I just purchased CS6 and all of the online videos talk about the new color matching feature.  But I don't see it anywhere.  How do I enable this feature?

  • FSCM: matching business partner and country code

    Hello FSCM community, simple task!? In FSCM i want to find all businesspartners matching a certain country code (e.g. all businesspartners with country code equals 'FR'. Since kna1 doesn't provide the data wanted, there has to be a different table. Q