Trying to get the default database connection

I'm trying to use the default database connection that the application server has but when I call this method I get an error :
Connection conn = (new oracle.jdbc.driver.OracleDriver()).defaultConnection();
java.sql.SQLException: Invalid Oracle URL specified
Do I have to do some setup? I don't want to hard code the connection URL in my code.
Thanks,
Merced

Hi Avi,
Thank you so much. I added the following and I was able to get the connection:
Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/DBConnection1CoreDS");
Connection c = ds.getConnection();
Currently I'm running it from JDeveloper and the data-source.xml gets generated automatically. How will it work when I deploy this application to the Oracle Application server? Do I have to update or copy data-source.xml? What does "jdbc/DBConnection1CoreDS" mean? I only know that in data-source.xml I have location="jdbc/DBConnection1CoreDS". I don't understand how Context is able to find this. I also deleted this entry from data-souce.xml but it got generated again. I don't understand that either.
Your help is appreciated.
Thanks,
Merced

Similar Messages

  • How do I get the default Photostream on my MacBook Pro to match the Photostream on my iPhone and iPad?

    Essentially, I am having issues getting photos that I save on my iPhone or iPad to automatically appear on my MacBook's iPhoto app (and vice versa). The iPad and iPhone automatically share all photos between each other. I have iCloud set up and all of the photo sharing options selected on all devices, so that's not the issue. I used a bit of a workaround and created and shared a custom stream, which ultimately works. However, it involves a lot of moving photos around on all three devices, so I'd like to get the Photostream service working the way it's intended by getting the default Photostream connected to my iCloud account automatically syncing among all three devices.
    Thanks.

    Photos are kept in the My Photo Stream for 30 days or until more than 1000 have been added.  The photos will remain in the MPS for longer than 30 days if the 1000 limit is not reached.
    However, depending on when a device joined the iCloud feature and started receiving the MPS it will not see any that were added more than 30 days from the date of joining.  So if your MBP signed into iCloud and the MPS feature later than the other 2 devices it will not see photos that they might.  Also if you've turned off My Photo Stream on the MPB and then added it back it will only see the last 30 days worth.

  • Trouble getting the default  user directory under Windows XP

    I m trying to get the default user directory under windows XP SP3.
    To do so, I'm using
    System.getProperty("user.home");
    I was expecting to get a path like "C:\Documents and Settings\user", nstead of that I get "C:\Documents and Settings\user\Destop".
    I checked the %USERPROFILE% and %HOMEPATH% window's environment variables and both of them are correctly set ( set to "C:\Documents and Settings\user").
    Is there any way to get the right path other than using : System.setProperty("user.home", "C:\\Documents and Settings\\user"); ?

    Thanks WalterLaan,
    The System.getenv("USERPROFILE") method will, at least, fix the problem under win XP.
    I guess i'll have to write a more refined method to be able to deploy my application under differents OSes.
    Regards.

  • Getting the default messaging app back

    i have a nokia e5-00. .bought it a few years back. .a month ago, i installed sms2.0 live app as the msging app. .it's done fine so far nw, bt i ws trying to get the default messaging app back but cant find a way to do so. There is no option to uninstall this app as it has nw become the native app for texting. Any help in this regard would be much appreciated. Thanx in advance.

    Did you try uninstalling by going to settings>application manager>installed apps>select app>select>options and select uninstall? 

  • I am trying to connect my Sony DCR-TRV350 to iMovie so that I can make DVD's from family videos.  I am having problems getting the video camera connected.  Any advice on how to do this?

    I am trying to connect my Sony DCR-TRV350 to iMovie so that I can make DVD's from family videos.  I am having problems getting the video camera connected.  Any advice on how to do this?

    What happens when, after you connect your cam, you go to File > Import Media?
    But before that, does your cam require you to export your video files upon USB connection? I have a JVC Everio HD and I have to "Export to Library" from the cam's menu first-thing. This was true even in prior iMovie versions.

  • Trying to update my apps on the iPhone 3.  When I type in user name and password, I get the message "Cannot connect to iTunes Store"  How can I connect?

    Trying to update my apps on the iPhone 3.  When I type in user name and password, I get the message "Cannot connect to iTunes Store"  How can I connect?

    I have the same problem. Any suggestions?

  • I am trying to get the music content on my Mac onto my iPhone. When I connect the devices, the computer does not seem to recognize the iPhone, i.e., on the open itunes window, the iPhone is not seen as a connected "device".

    I am trying to get the music content in iTunes on my Mac onto my iPhone. When I connect the devices, the computer does not seen to recognize the iPhone. i.e., on the open iTunes window, the iPhone is not seen as a connected "device".

    Hi,
    See Here
    iPhone, iPad, or iPod touch not appearing in iTunes
    From Here
    http://www.apple.com/support/itunes/devices/
    Also...
    Device Not Recognised
    For PC
    http://support.apple.com/kb/TS1538

  • HT204266 Trying to check for updates but when I hit updates I keep getting the message  cannot connect to iTunes. I'm signed in in my settings so not sure what else to do?

    I'm trying to connect to the app store to check for updates but when I go to the update tab I keep getting the message cannot connect to iTunes store. I am signed into iTunes in my settings so not sure what to do!

    You should not get that message if you are simply trying to load the shuffle with songs from your iTunes library.  If iTunes is trying to Update or Restore the shuffle, and you get that message, try the suggestions in this article
    http://support.apple.com/kb/TS1814

  • When I try to do anything with the App store I get the message "Cannot connect to the iTunes Store". I have internet connections and I have tried resetting the password.

    I cannot connect to the iTunes store for any purpose. When I try I get the message: "Cannot connect to the iTunes Store". That is all. I have tried a lot of different things except , obviously, the correct thing.

    HI ...
    Try this support article > Can't connect to the iTunes Store

  • When trying to purchase something from itunes on my phone after typing my apple account password I get the message cannot connect to itunes store.

    I am trying to purchase something on itunes. I type in my apple id password and then I get the message cannot connect to itunes store..

    Am having the same issue

  • I am trying to download a free app but after entering my correct password I get the message "Cannot connect to iTunes Store". The only option then is to hit OK, which achieves nothing. How can I connect?

    I am trying to download a free app to my iPhone 4, but after entering my correct password I get the message "Cannot connect to iTunes Store". The only option is to hit OK which achieves nothing. How can I connect to the store?

    Might be help for you here >  Can't connect to the iTunes Store

  • When trying to start premiere i get the warning please connect to the internet and retry. I have internet connectivity.

    when trying to start premiere i get the warning please connect to the internet and retry. I have internet connectivity. Help!

    dynomited
    As mentioned, starting with version of Premiere Elements that is being used and the computer operating system on which it is running are important in generating troubleshooting strategy.
    But, the description of what you wrote caught my attention with the words "trying to start" and mention of need for Internet connection when you knew one existed. What was the exact full message from the program in this regard?
    Depending on further details from you, you may have run into the same issue that I did recently. I have written about the experience including the remedy
    ATR Premiere Elements Troubleshooting: PE12: Sign In Failure (Connect to Internet or Fix Computer Clock)
    The answer for me was to update the Adobe Application Manager as per the input of an Adobe Staff member. Details in the above blog post.
    We will be watching for your results.
    Thank you.
    ATR

  • Hi there,both my uncle and i are using iphone 5 that runs on 6.1.2 whenever i send or receive tweets i'am not getting the twitter default sound,i'am getting tri-tone sound.My uncle however would get the default twitter sound whenever he sends or receive.W

    Hi there,both my uncle and i are using iphone 5 that runs on 6.1.2 whenever i send or receive tweets i'am not getting the twitter default sound,i'am getting tri-tone sound.My uncle however would get the default twitter sound whenever he sends or receive.What's up with that?

    Check: Settings - Sounds - Tweet - Set to your preference.

  • How to config the oracle database connection pool in IAS

    Hi,
    Does anyone who hows to config the oracle database connection pool in IAS?
    Thanks so much!!!
    [email protected]
    Jacky

    Jacky,
    You need do the following for oracle type4 driver:
    1) register the driver:
    $IAS_HOME/bin/jdbcsetup
    Driver Identifier: Oracle_Type4_816 (whatever name you like)
    Driver Classname: oracle.jdbc.driver.OracleDriver
    Driver Classpath: .../classes12.zip (install this this zip file somewhere
    and add this zip into the Classpath later).
    2) DataSource Setup:
    start iAS Administration Tool (iASAT)
    Choose Database, unfold iAS1 (your app server instance),
    choose External JDBC Datasource -> add: DataSource Registration
    JNDI Name: yourPoolName
    Driver Type: Oracle_Type4_816 (select what you just register)
    DataSource Url: jdbc:oracle:thin:@hostName:portName:dbName
    Username: your_user_name
    Password: your_passwd
    (Datasource Pool: using defaults for now): you can also customrize the
    parameters for the pool.
    3. Add classes12.zip into CLASSPATH.
    In your application, you can use JNDI lookup to get the DataSource from
    which you get the connection from the pool.
    Hope this helps.
    Good luck.
    Xuran
    "Jacky Yan" <[email protected]> wrote in message
    news:9m0tmp$[email protected]..
    Hi,
    Does anyone who hows to config the oracle database connection pool in IAS?
    Thanks so much!!!
    [email protected]
    Jacky

  • SQLPlus Default Database Connection

    I have two Oracle databases installed on the same LINUX server. One is a training database that is rarely even running.
    When logging in through SQLPlus and only supplying userid and password, the database to which the connect is attempted varies depending on the userid I am currently logged in as under LINUX. Under one userid, SQLPlus even attempts to connect to the idle training database. The 8i documentation indicates that setting the default database for SQLPlus is OS specific. Does anyone know how this is specified under LINUX?

    Joseph,
    That was one of my guesses, as well, but it doesn't seem to behave consistently.
    The .bash_profile files for both the oracle and mdm user are the same, however, the oracle user is able to default to the correct database, whereas mdm cannot.
    Here's the profile for mdm:
    $ cat .bash_profile
    # .bash_profile
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
    . ~/.bashrc
    fi
    # User specific environment and startup programs
    DISPLAY=localhost:0.0; export DISPLAY
    ORACLE_BASE=/usr/oracle; export ORACLE_BASE
    ORACLE_HOME=/usr/oracle; export ORACLE_HOME
    ORACLE_SID=pmisbk; export ORACLE_SID
    #ORACLE_SID=oralin; export ORACLE_SID
    ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data; export ORA_NLS33
    ORAENV_ASK=NO; export ORAENV_ASK
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib; export LD_LIBRARY_PATH
    umask 022
    NLS_LANG=american_america.EE8ISO8859P2; export NLS_LANG
    #PATH=$PATH:$HOME/bin
    PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/ActivePerl-5.6/bin:$PATH:$HOME/bin:$ORACLE_HOME/bin
    BASH_ENV=$HOME/.bashrc
    USERNAME=""
    export USERNAME BASH_ENV PATH
    . /usr/local/bin/oraenv
    and behavior:
    $ echo $ORACLE_SID
    pmis
    $ sqlplus
    SQL*Plus: Release 8.1.6.0.0 - Production on Thu Apr 25 14:01:10 2002
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Enter user-name: mdm
    Enter password:
    ERROR:
    ORA-01034: ORACLE not available
    Enter user-name: mdm@pmisbk
    Enter password:
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.0.0 - Production
    SQL> exit
    Disconnected from Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.0.0 - Production
    and the .bash_profile for oracle:
    $ su - oracle
    Password:
    $ cat .bash_profile
    # .bash_profile
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
    . ~/.bashrc
    fi
    # User specific environment and startup programs
    DISPLAY=localhost:0.0; export DISPLAY
    ORACLE_BASE=/usr/oracle; export ORACLE_BASE
    ORACLE_HOME=/usr/oracle; export ORACLE_HOME
    ORACLE_SID=pmis; export ORACLE_SID
    #ORACLE_SID=oralin; export ORACLE_SID
    ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data; export ORA_NLS33
    ORAENV_ASK=NO; export ORAENV_ASK
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib; export LD_LIBRARY_PATH
    umask 022
    NLS_LANG=american_america.EE8ISO8859P2; export NLS_LANG
    CLASSPATH=.:$ORACLE_HOME/jdbc/lib/classes111.zip:$ORACLE_HOME/sqlj/lib/translator.zip; export CLASSPATH
    PATH=/usr/local/ActivePerl-5.6/bin:$PATH:$ORACLE_HOME/bin
    BASH_ENV=$HOME/.bashrc
    USERNAME=""
    export USERNAME BASH_ENV PATH
    . /usr/local/bin/oraenv
    and the behavior:
    $ sqlplus
    SQL*Plus: Release 8.1.6.0.0 - Production on Thu Apr 25 14:07:47 2002
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Enter user-name: mdm
    Enter password:
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.0.0 - Production
    SQL> exit
    Disconnected from Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.0.0 - Production
    Perhaps this is because the Home directory for the oracle user is the same as $ORACLE_HOME.
    You may have noticed the connect string for mdm was to pmisbk. That's the alias in the tnsnames.ora file, otherwise if you try using pmis you get:
    Enter user-name: mdm@pmis
    Enter password:
    ERROR:
    ORA-12154: TNS:could not resolve service name
    and have to enter:
    Enter user-name: mdm@pmisbk
    Enter password:
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.0.0 - Production
    SQL> exit
    If you specify pmisbk and the ORACLE_SID in the .bash_profile file, when you log into the server it prompts you:
    ORACLE_HOME = [usr/oracle] ?
    presumably because /etc/oratab does not contain an entry for pmisbk. You can respond with RETURN and the variable contains the correct path, but all the other behavior is as described above.

Maybe you are looking for

  • Fault handling policy for a process in the fault-binding.xml

    Can I specify a fault handling policy for a specific process using fault handling framework 10.1.3.3? <process faultPolicy="DefaultPolicy"/> I cannot specify the name of the process according to the xsd :( Can this be achieved? I have a two different

  • Keyboard envy dv7 - missing letters

    I've noticed while I'm typing in a document/email, etc., I have a lot of missing letters, forcing me to back up and fix them.  I'm not a particularly fast typer, but I did not have this problem when I was using another HP laptop with Windows 7.  Now

  • Need help using weblogic.Deployer to refresh a webapp

    I'm trying to refresh some jsp from a webapp deployed in exploded format in WLS 8.1SP3 The original source files are not located on the machine or filesystem running the admin server (the webapp is deployed on a cluster) On WLS 6.1SP5, we use weblogi

  • Glitch with Firefox and Adobe Reader.

    I wasn't sure whether to post this in the Adobe Reader forum or the Mozilla Firefox forum, but decided to post here. I am running the latest versions of Adobe Reader X and Firefox on Windows Vista. Open Firefox. Open a new tab. Then open an Adobe Acr

  • Dynamically adding a row

    Hai I am stuck with how to dynamically add a new row to my jtable provided that I do not know in the first place how many rows of data will the user enter. Thanks a lot.