Why ctx.lookup(name) differenct bw sessionbean and  entityBean for DBconnec

i want to get dbconnection other than entity bean, in entity bean,
the connection is got from the datasource, which built under the clause as
String dbName = "java:comp/env/jdbc/CustomerDB";
InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup(dbName);
however, the "dbName" is different completely from session bean processing,
it has to be
String dbName = "jdbc/Cloudscape";
my question is :
why the same context object, has to use different key to get the same DataSource
object?
thanks for tips
best regards,
Frederick Van TaGero

You can access env. in two ways
1.
// Obtain the enterprise bean�s environment naming context.
Context initCtx = new InitialContext();
Context ic= (Context)initCtx.lookup("java:comp/env");
DataSource ds = (DataSource) ic.lookup("jdbc/Cloudscape");
or full as
String dbName = "java:comp/env/jdbc/CustomerDB";
InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup(dbName);

Similar Messages

  • Why it takes long time to download and udates for iphone4

    why it takes long time to download and updates for iphone4 ?

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Why do you need this if you are going to Oracle. Try
    removing this. It might be trying things out with the
    old driver and then moving to the new driver. This has nothing to do with it. (And it doesn't "try things out")
    >
    Also check your machines. They might be slow. There is
    no reason, it should take more than few hundred
    milliseconds to connect to a database on localhost as
    your case is.Possible reasons...
    - Network traffic
    - Faulty router/gateway
    - Busy server
    - Faulty network card (either end)
    - Conflict with another box

  • Why do contacts name keep getting longer and longer?

    On some of my contacts, the name keeps getting longer and longer.
    For example, if my name is Jason Kahng.
    After a few weeks, when I lookup my name in Contacts it comes up as "Jason Kahng Jason Kahng Jason Kahng"
    This is very annoying. If I edit the name back down to Jason Kahng, it will do this again a few weeks later.
    Please let me know how to fix this problem.
    Thank you!

    Your iPhone uses Wi Fi to sync your contacts, not iTunes with iOS 5.0.1
    Tap Settings > iCloud
    Switch Contacts off then back on then reset the iPhone.
    Hold the On/Off Sleep/Wake button and the Home button down at the same time for at least ten seconds, until the Apple logo appears.

  • Why can't I get Keynotes Pages and Numbers for free after OS Mavericks 10.9.1 Upgrade?

    I bought my Macbook Air a few days ago with the OS X Mavericks 10.9.1 update software already installed on my laptop. I'm suppose to get Keynotes, Pages, and Numbers for free under purchases in my app store but unfortunately I haven't seen any of those programs come as a purchase in my store. I've downloaded the OS Mavericks 10.9.1 software three times already and restarted my computer to see if they come in the mac store but nothing happened. I've also applied for the Up to Date program and they said they would contact me in 24 hours but it has been three days and I still haven't got a reply from them.

    If you purchased a qualifying Mac on or after October 1, 2013, that did not include Pages, Numbers, and Keynote, you can download them free by following these steps: http://www.apple.com/creativity-apps/mac/up-to-date/

  • Why does my name appear on the iCloud account for everyone in my family?

    There are four members of my family, and we each have our own Apple ID and password that we use to sign into iCloud. We also use a variety of devices -- iPhone, iPad, Safari on Mac, etc. When any of us sign on to iCloud, we see our own individual photo, but only my (Dad) name! For example, using her laptop, my daughter logs onto iCloud via Safari, using her own Apple ID and password, and then in the upper right hand of the screen there's a small photo of her and then my name! The problem is that we're now sharing pictures via Photo Stream, and when any of us make a comment, it seems that I'm the (only) one making the comment. I already went to the Apple Store and showed the Genius Bar guy what I'm talking about and he had no idea why this was happening or how to fix it. Help please!

    Back up all data if you haven’t already done so. Before proceeding, you must be sure you can restore your system to the state it’s in now.
    In the Finder, hold down the option key and select Go ▹ Library from the menu bar. From the Library folder, move the following items to the Trash, if they exist:
    Application Support/Dock
    Caches/com.apple.dock
    and move the following item(s) to the Desktop:
    Preferences/ByHost/com.apple.dock.*.plist
    Preferences/com.apple.dock.db
    Preferences/com.apple.dock.plist
    Here “*” stands for a long string of letters and numbers. Log out, log back in, and test. If you still have the issue, put the item(s) on the Desktop back where they came from and post again. Otherwise, move the items on the Desktop to the Trash and empty.

  • Custom Column Name in Webpart file and Itemstyle for Content Query WebPart

    I was trying to incorporate  a custom column in the content Query WebPart.
    The name of the column displayed in the list is "Risk Score"; a calculated column.
    I right clicked on the field in the list settings and copy hte short cut which is pasted below:
    http://<mainURL>/_layouts/FldEdit.aspx?List=%7BFE4CC761%2DE9B8%2D487C%2D8B92%2D1E42539144C4%7D&Field=Risk%5Fx0020%5FScore
    Could you please let me know what can i type in the WebPart file exported and then to be imported in the section:
    <property name="CommonViewFields" type="string"></property>
    Also, please let me know what should i enter in the itemstyle.xsl in the section
    <td style="width:30%; font-size:10px;font-family:Verdana;color:#007EB6; border-style:solid; border-width:medium;border-color:#E1E1E1;">
    <xsl:value-of select="@Risk%5Fx0020%5FScore" />
    </td>
    Tnx

    Ok.
    Use like this
    <property name="CommonViewFields" type="string">RiskStrore,Lookup</property>
    and include like this in the itemstyle
    <td >Risk store
         <xsl:value-of select="@RiskStore" />
        </td>

  • Why does airport cycle continually between "on" and "looking for networks"

    I've been trying to find the answer to this for what seems like weeks. My macbook (Lion), my girlfriends macbook pro (Snowleopard) an iPhone 3G and an iPhone4 all seem to be unable to simply keep a steady connection to my WiFi.
    They all connect, but then "looking for network", then "on" and repeat this cycle over and over.
    I know this is effecting the signal and data transfer, because if i do a speedtest, you can see the signal drop off to next to nothing when its "looking for network" and come back to strength when "on"
    This sometimes causes the connection to hang, or disconnect completely. The cycle length seems to vary, but is generally around 5-8 seconds. Then sometimes it is connected for say 7 secs and then looking for 12 secs.
    This is not specific to my network either. My brother who lives 1.5 hours away has the same thing happening on his iMac, and if i log on to his network with my iPhone 4, it shows the same behaviour.
    What the **** is going on?
    My IP has tested stuff from their end, all is fine. If i connect via the ethernet, no problems. They have changed the router twice and are now sending another, but it must be a problem with Apple devices.
    Any ideas?, have i missed the explanation/solution in my searches?
    thanks for any pointers

    It should but then Mountain Lion who knows..
    I recommend you reset the TC and use proper SMB network names.. for TC itself, wireless and hard disk.
    Use fixed channels.. and different name for 5ghz.
    And WPA2 Personal security.
    Did you upgrade install ML?? Or was it supplied with Mountain Lion... ?

  • Why I have to buy Lion Server and Lion for $83.98???

    I want to upgrade my MAC OS X Server 10.6.8 to Lion Server......
    But the App store insists I buy Lion as well... AND it has tried to charge me $83.98 for it.... (The Australian dollar is closely on parity with US dollar)..
    So.. I already downloaded Lion.... and installed on my imac.... now I want to upgrade my server.. why do I have to buy lion again??? And why so expensive compared to the rest of the world??
    Gaz

    For those that don't see the prompt to buy Lion + Lion Server again, there's no need to respond because you aren't having this issue and any obvious input, is just that.. obvious.
    For those with this issue, Apple Care won't be able help you because it's a download issue and not an install issue and they suggested to contact the Mac App Store (iTunes Store) support for assistance.   Sadly it's e-mail only and probably will take some time.  You could try a clean install of SLS to upgrade to LS, but that still might not work. Other than attempting the pain of wasting a day to do a fresh install before the upgrade, I've tried logging out and back in with the Mac Store, created a second admin account and used the same AppleID and both still prompted me to Buy Lion+Lion server again.  
    For those that haven't clicked on the buy, I still hit an issue that preventing me from downloading the Lion Server after the 4GB Lion image downloaded.  You will probably have to request the refund if you attempted this, but guessing you still won't be able to install.   Also if you try to upgrade from SLS to just Lion, you will be prompted to buy Lion Server as well.   So in the end, it's up to the Mac App Store e-mail to resolve this or perhaps I can attempt to do the clean install.

  • Why do my numbers documents not open and ask for a newer version

    trying open numbers docs, told need newer version to open them, go to apps search for updates and none exist, *** Apple??? please tell me how to commence and open my business docs to do my work?

    Hi Kiwi Wodner,
    This is confusing to a lot of people. When you downloaded the new version of Numbers (this would have happened automatically unless you turned off 'Install app updates' in System Preferences > App Store) the old version remained on your Mac. The new version is in Applications. The old version is in a subfolder within Applications. The icons look similar so it's easy to think you're trying to open a document with the new version whereas in fact the old version has been activated and is trying to open it.
    If you tend to open documents from Finder then right-click and Open With ... Numbers.app (3.0).
    Or you can open Numbers 3.0 (the one in the Applications folder, not the iWork '09 subfolder) and open the document from there.
    Any icons you had on the Dock before the upgrade are of course still pointing to the old version.
    SG

  • Why can't I download Pages, Keynote,  and Numbers for free even though I got my Mac and iPad mini as a student?

    I bought my Macbook Pro and iPad mini at the Palisades Mall, New York location and was told that I can get those same apps for free on my Mac. I have been using my iPad mini for assignments and have never been able to download Pages, Keynote or Numbers on my Macbook Pro, despite having the same Apple ID and having all of these apps on my iPad Mini.
    I don't know the exact day I got my Macbook Pro, but I have the serial number and I know the month and year I purchased it.
    Yes, I got the student discount on both items, but the apps are only on my iPad mini.

    iOS and OS X versions of these apps are entirely different apps. Getting one free doesn't entitle you to the other.
    Pages, Numbers, and Keynote are free on the Mac App Store for qualifying Mac computers purchased on or after October 1, 2013. OS X Yosemite required. Downloading apps requires an Apple ID.

  • Why apple forced us to buy iphoto and imovie for new ipad? it supposed to be free for new ipad?

    i think iphoto and imovie should have pre installed in new ipad. Apple wants to make money of everything. i guess in future apple will make ipad without any application and everything have to pay to download from app store.

    Apple didn't force you to buy anything at all including the iPad. You made the choice to buy the iPad. You do not have to but iPhoto or iMovie. Nobody is forcing you to buy anything.
    As stedman already said - all apps cannot be free.

  • Why is the repair process so long and painful for a item that is still under original factory warranty

    The repair process for items under original factory warranty are unacceptable as it takes way too long to get in touch with a repair representative or get a repair performed.  Meanwhile I am without my Sony 4k tv.  The whole long process has been a complete nightmare and I am seriously regretting my decision to purchase a Sony tv as well as debating if I will ever buy another Sony product.  I would love to share my story with a supervisor as I had asked to speak to one and was told I can't.....even after several kind requests.  I want to offer constructive criticism as I can see on many forums people are losing faith in Sony and their products.  Can a supervisor or someone with some authority contact me? Sincerely, David Jablonski

    Hi David. I'm in the exact same boat. I have a $2500 projector (HW40) that started giving trouble. It's been 4 weeks now and no telling how much longer they will take to fix it. No communication either. The phone support is useless. You waste hours and hours (literally) on hold and getting the runaround. I'll never ever buy Sony again. I'm sharing my horrible experience on the A/V forums and have already steered quite a few to the Epson and/or JVC projectors. Sony will never get another dime from me.

  • Why is my lightroom not downloading.  Just sitting and spinning for 30 minutes

    Why is my Lightroom install just sitting and spinning for over 30 minutes?  Not downloading

    I decided to back up my photos to an external drive just in case my
    computer doesn't turn on one day. I backed up the catalog to my hard
    drive, was this wrong of me to do?
    Backing up your catalog is never a bad idea. In fact, you should do so frequently. BUT, don't confuse backing up the catalog with backing up your photos. The photos are not "in" the catalog which is nothing more than a big ole' list of information about your photos - where they are on the disc, what edits you will want done to them when it comes time to export them, what tags or collection memberships are associated with them, etc. - but the photos themselves are in whatever folders you put them into.
    If your original catalog file got moved or deleted, LR will give you a notice that says something like, "LR cannot find the catalog. Do you want LR to make a new catalog?" If you "OK" this, it will create a new empty catalog. If you then reimport all your photos they will be without edits (or more precisely with default edits). What you need to do is to either find your original catalog on your hard disc (a file that has the extension .lrcat) or copy the backup that you made back to somewhere on your internal HD. Then double-click on the .lrcat file and LR will open with the catalog that contains all your edits.

  • How to find the tables and extractor for my dataload

    Hi all,
    I am new to BW. Can someone tell me which tables and fields I need if I load data (sales report;t code:MCTG; s001)from R3 to BW. Which extractor do I need in LBWE or SWIB?
    I may need to answer as soon as possible. Any hlep will be appreciate. Thank you.
    Koala

    hi,
    you wrote that you have specific requirements for your raport so you should build your own extractors:
    http://help.sap.com/saphelp_nw04/helpdata/en/e9/6bf2d90e533f409ee56d3f586c325a/frameset.htm
    and here you find document how to create delta extractor:
    https://websmp101.sap-ag.de/bi -> infoindex -> delta handling
    and take a look on ...infoindex -> extraction as well
    If you want to build extractor on infoset you can create infoset in sq02
    Extractors in sbiw are not build to extract data from particular tables but as part of data source for BC cubes
    Regards,
    Andrzej
    ps. ...and way I use to find what tables particular transaction use is:
    go to this transaction screen -> system -> status -> copy program name -> go to se38 -> paste program name -> display source code -> and look for statement 'tables:' there will be list of tables this program use (this statement can be under INCLUDE XXXXXTOP)
    Message was edited by: Andrzej Krysiuk

  • Why java file name and class name are equal

    could u explain why java file name and class name are equal in java

    The relevant section of the JLS (?7.6):
    When packages are stored in a file system (?7.2.1), the host system may choose to enforce the restriction that it is a compile-time error if a type is not found in a file under a name composed of the type name plus an extension (such as .java or .jav) if either of the following is true:
    * The type is referred to by code in other compilation units of the package in which the type is declared.
    * The type is declared public (and therefore is potentially accessible from code in other packages).
    This restriction implies that there must be at most one such type per compilation unit. This restriction makes it easy for a compiler for the Java programming language or an implementation of the Java virtual machine to find a named class within a package; for example, the source code for a public type wet.sprocket.Toad would be found in a file Toad.java in the directory wet/sprocket, and the corresponding object code would be found in the file Toad.class in the same directory.
    When packages are stored in a database (?7.2.2), the host system must not impose such restrictions. In practice, many programmers choose to put each class or interface type in its own compilation unit, whether or not it is public or is referred to by code in other compilation units.

Maybe you are looking for

  • Rename Tables in Numbers 3.0

    I've been using Numbers '09 for several years, and I have one spreadsheet that has 2 sheets (2012, 2013) and each sheet has multiple tables.  In Numbers '09, I was able to copy and entire tables, and after the paste it would have the same name as the

  • SQL index of facttable disappears after full optimize + compress db

    Hello all, I have a customer that is using Outlooksoft 4.2sp3 for more then a year now. Every weekend a full optimize + compress database is running. Since 4 weeks, the SQL index of the fact table is disappeared after a full optimize+compress. They u

  • Using Flash Variables in Excelsius

    Dear Experts. I have a dashboard in Xcelsius which has multiple sheets(60 Sheets) where navigation to every other page is done using the push buttons " Back and Next ". This functionality is working fine without creating any issues. Now, the customer

  • Flash Player not working in Vista 64 bit OS

    I get an error message that Adobe is working on a solution for a 64-bit OS but have not found a workable download. HELP!

  • Suddenly Unable to Connect to Exchange Server

    I set my iphone 3g without with our ms exchange server. I had no problems. Sending, receiving, calendar, and contacts all worked perfectly for weeks. One day it just stopped working. I receive "Cannot Get Mail - The connection to the server failed" w