How to protect JDBC data srouce

How to configure the WebLogic server to enable users to access data sources through beans only? I don't want the users to look up the data source objects directly in the JNDI tree and use them?
My problem is this: if I disable the users to look up the data source objects, the users will not be able to use the beans to access the data sources any more.

For 11.1.1.7.1 use the syntax for jdbc_sid, i.e.
//mypdb1.foo.com as described in the README,
- MapViewer native (non-container) data sources can now use database service name in place of SID. To supply a db service name, you will use the same jdbc_sid attribute, but specify the service name with double slashes in front, such as follows:
  <map_data_source name="myds"
    jdbc_host="foo.com"
    jdbc_sid="//mypdb1.foo.com"
    jdbc_port="1522"
  />
For 11.1.1.7.0 use a container_ds instead.
i.e. instead of using
<map_data_source name="my_12c_test"
                   jdbc_host="mydbinstance"
                   jdbc_sid="pdborcl12c"
                   jdbc_port="1522"
                   jdbc_user="mytestuser"
                   jdbc_password="m2E7T48U3LfRjKwR0YFETQcjNb4gCMLG8/X0KWjO00Q="
                   jdbc_mode="thin"
                   number_of_mappers="6"
                   allow_jdbc_theme_based_foi="false"
                   editable="false"
   />
use
  <map_data_source name="my_12c_test"
                   container_ds="jdbc/db12c"
                   number_of_mappers="6"
                   allow_jdbc_theme_based_foi="false"
                   editable="false"
   />
In my case the Glassfish 3.1.2.2 JDBC connection pool definition was
Property
url  jdbc:oracle:thin:@mydbinstance:1522/pdborcl12c.rest_of.service.name
Uncheck the Wrap JDBC Objects option in Advanced panel, i.e. the Edit JDBC Connection Pool Advanced properties page.
Add a JDBC resource for that newly created pool
Use that in mapviewerconfig.xml as above

Similar Messages

  • How to set JDBC Data Sources in Oracle MapViewer for Oracle database 12c Release 1 (12.1.0.1)

    How to set JDBC Data Sources in Oracle MapViewer for Oracle database 12c Release 1 (12.1.0.1)?
    The following is my configuration in the conf\mapViewerConfig.xml:
    <map_data_source name="mvdemo12"
    jdbc_host="127.0.0.1"
    jdbc_sid="orcl12c1"
    jdbc_port="1522"
    jdbc_user="mvdemo"
    jdbc_password="7OVl2rJ+hOYxG5T3vKJQb+hW4NPgy9EN"
    jdbc_mode="thin"
    number_of_mappers="3"
    allow_jdbc_theme_based_foi="true"
    editable="true"/>
    <!--  ****  -->
    But it does not work.
    After use "sqlplus mvdemo/[email protected]:1522/pdborcl", it connected to the Oracle database 12c.
    Does anyone know it?
    Thanks,

    For 11.1.1.7.1 use the syntax for jdbc_sid, i.e.
    //mypdb1.foo.com as described in the README,
    - MapViewer native (non-container) data sources can now use database service name in place of SID. To supply a db service name, you will use the same jdbc_sid attribute, but specify the service name with double slashes in front, such as follows:
      <map_data_source name="myds"
        jdbc_host="foo.com"
        jdbc_sid="//mypdb1.foo.com"
        jdbc_port="1522"
      />
    For 11.1.1.7.0 use a container_ds instead.
    i.e. instead of using
    <map_data_source name="my_12c_test"
                       jdbc_host="mydbinstance"
                       jdbc_sid="pdborcl12c"
                       jdbc_port="1522"
                       jdbc_user="mytestuser"
                       jdbc_password="m2E7T48U3LfRjKwR0YFETQcjNb4gCMLG8/X0KWjO00Q="
                       jdbc_mode="thin"
                       number_of_mappers="6"
                       allow_jdbc_theme_based_foi="false"
                       editable="false"
       />
    use
      <map_data_source name="my_12c_test"
                       container_ds="jdbc/db12c"
                       number_of_mappers="6"
                       allow_jdbc_theme_based_foi="false"
                       editable="false"
       />
    In my case the Glassfish 3.1.2.2 JDBC connection pool definition was
    Property
    url  jdbc:oracle:thin:@mydbinstance:1522/pdborcl12c.rest_of.service.name
    Uncheck the Wrap JDBC Objects option in Advanced panel, i.e. the Edit JDBC Connection Pool Advanced properties page.
    Add a JDBC resource for that newly created pool
    Use that in mapviewerconfig.xml as above

  • How to create JDBC data source w/o LDAP server

    I am trying to test using JDBC data source on a computer without a LDAP server. Is there an alterative JNDI solution? How about using file system or RMI registry JNDI service providers?

    Any J2EE container should be able to handle that. I use JNDI data sources with Tomcat 4.1.27. I'm sure any other J2EE app server (e.g., WebLogic, WebSphere, JBOSS, etc.) would be able to manage it, too. - MOD

  • How to protect personal data?

    Hi all,
    I have to take my MacBook Pro to the repair shop to get a speaker replaced.
    When I filled out the paperwork for the repair, the tech asked me to write down my login password.
    My computer has two accounts set up: my main user account (with my home folder) as well as a test account which I created when trying to resolve other issues.
    I'm a little concerned about providing the password to my personal account, with so much sensitive data, i.e. logins and passwords, stored in my browser plus all of my personal files.
    What is the best way to protect my data in a case like this? Can I change my admin password, and provide the password to the test account only? Or does the tech need access to an admin account (my personal user account) for this type of repair?
    Thanks for any advice.

    If you create an Admin account for them to use, it should be fine, but I'd check with them. I don't see a reason they would need access to your personal account; they just need an admin account to be able to check things out.
    Logging in with another Admin account will not give them access to your files, unless they use the terminal. They won't be able to see your passwords in Keychain, though.
    They could also just use any install disk to change the password if they want to get to your data. Again, they can't get to your passwords as that method does not change the keychain password.
    They could also just connect the drive up to another computer and have full access to your data.
    You can encrypt your entire home folder using FileVault, but I would back up all of that data before you enable it. They would have to be ok with using another Admin account on the computer for this to work as your login password unlocks FileVault.
    Once you lose physical control of your computer, the only way to protect your personal data is to encrypt it.

  • How can I protect my data in numbers from unintentional user of my iPad by other family members? In other words, how can I password protect my numbers and other apps from apple computer company?

    I have other members of my family use my iPad for educational/recreational use, young children who may want to play kid games. I don't want them to accdently get into my data stored in the three business apps from apple. I would like to password protect these files.
    I would also like to log out of the email systems that I use, so some one else can use this device to access their own emails. By leaving my accounts open al the time, is really asking for trouble from a host of sources.
    I can't believe that the iPad is not designed to protect the privacy and data from prying eyes ... Un intuitional as it may be.
    Please fix this issue so I create my info on this device and enjoy it fully. Or tell me how I can protect my data.
    Thnax.

    Thanx for your response. Any data stored anywhere should be able to be protected from stealing, malicious destruction or unintentional destruction. Theo ad an be stolen and without any kind ofpassword protection, the thief could get into your sensitive data.
    If Apple wants iPad to become a business tool that can be used with ideas, thots, data protected, then Apple needs to provide this protection to it's customers. Now it's unto the users to use it or not.
    I know iPad is being considered to be used by doctors, and can u imagine the confidentiality requirements of HIPPA rules... It will make this device not usable without data protection. I am sureweall have heard about hacking going on at all levels. It's surprising that this device's software is left unprotected.
    My iPad may be sitting on my desk and my 3 year old grand daughter would pick it up and start "playing" with it. That means I can't store anything on this machine that may possibly be changed.
    I have discussed this with specialists in apple stores, and those who have been around info technology understand my concerns and they may forward this request further up. They do not have the answer for it..... So far.
    I think data security should be everyone's concern... Be it a one person device or multiple user device.
    I hope that some responsible people at Apple would read this and provide the protection that will make this device lot more acceptable in the business world.

  • WLS 10.3.4: How to use OS authentication for JDBC Data Source

    Hello all,
    As a preface, I've tried searching the forum/Google for "OS authentication" and reading the WLS JDBC doc to no avail - if it's documented somewhere, a RTFM link would be much appreciated.
    I'm trying to set up a JDBC data source on WLS that leverages the OS Authentication capability of the Oracle database. If it would help, I can go into the reasoning behind why I want to do this, but basically, it's to simplify the config/deployment of a COTS application. What I have in the database is an "identified externally" user that corresponds to the OS user that is running the WebLogic Server. Normally, in tools such as SQL*Plus, I would use "/@db" as the username/password (in other words, no username and no password specified), and I would be logged in as the "idenfitied externally" user. I want to configure the same thing for a WebLogic Data Source, but if I leave the username/password blank, testing the connection in the WLS console gives me "invalid username/password, login denied" I've also tried using "/" as the username, as was documented in a quite old WLS faq, but that gives me the same result.
    Is there some magic switch I need to flip?
    Thanks,
    John

    Hi John, there's no way to do that with connection pools, which is how WLS datasources get their
    connections, or middleware in general. WebLogic would have no way of knowing which if any of the
    pooled connections was appropriate for the current 'user', which is not the application user, but
    instead is the OS identity of the person who started the WebLogic server! If you start up your
    WebLogic server, and people start pointing their browsers to it, doing various stuff, the OS knows
    you started WebLogic, and maybe with the help of OCI, Oracle's JDBC might know it was you who
    started WebLogic's OS process, but what does the OS know about any user that may be running
    a browser or application elsewhere (even if on this same machine), when that browser or application
    connects to your WebLogic server process?
    HTH,
    Joe

  • Sharing iPad2:  how to protect my own data when others use it?

    A single iPad2 is shared with others.  How do we protect individual data when others use the iPad?

    I use iCab and Comcast email with no problems. Try restarting your iPad. Try quitting iCab, restart the iPad and then try again. Just keep fighting the loop and see if you can ultimately get it to work if you have to.
    Try using the Connect Lite version of the Xfinity/Comast mail on the iPad. You will have to change that in the preferences on the server. It is in the general section. You want to select Xfinity Connect Lite. I have Comcst and I think this makes it a little easier to navigate and its a little more iPad friendly.
    If you want to be able to write mail in the Comcast webmail on the iPad you have to change to use Plain Text instead of HTML in the Composing preference. If you don't, the keyboard will not popup when you tap in the text field. You will be able to enter the email address in the To: field and the subject in the subject line but that is all unless you switch to plain text.
    I actually prefer the mail app on the iPad to using the Comcast webmail but that's just my preference.

  • How to create Hive data source?!!

    I am trying to create hive data source connection.
    I am stack on creating connection profile and configuring "Generic JDBC Driver" .. after i added drivers i keep getting " Required property in driver definition missing value: Driver Class." error.
    I am adding a screenshot with the list of drivers.

    Kevin
    In Jdbc node create a Jdbc Connection Pool with the
    Url=jdbc:borland:dslocal:/jbuilder6/samples/Ejb/db/esite.jds
    and driver=com.borland.datastore.jdbc.DataStoreDriver. Create a Datasource
    using a Jndi & Jdbc Connection Pool.
    Deepak
    Kevin Gao wrote:
    in jbuilder6 samples instructions,there is instruction as:
    Create a WebLogic data source named ESiteSource. You will need to check
    your WebLogic documentation on how to create a data source. You will need
    the following settings
    1.The database URL should be of the following format:
    jdbc:borland:dslocal:/jbuilder6/samples/Ejb/db/esite.jds, ensuring that you
    have the correct path to esite.jds.
    2.The driver will be com.borland.datastore.jdbc.DataStoreDriver.
    3.This JDataStore is not password protected, but you must still specify a
    user; any user will do, e.g., user=Frank;password=
    but how to create a data source in weblogic?
    help me please!
    thanks in advance!
    Kevin Gao
    EMAIL:[email protected]

  • How can I Move data from one column to another in my access table?

    I have two columns, one that stores current month’s data and one that stores last month’s data. Every month data from column 2 (this month’s data) needs to be moved to column 1 that holds last month’s data. I then null out column 2 so I can accumulates this month’s data.
    I understand how to drop a column or add a column, how do I transfer data from one column to another.
    Here is my trial code:
    <cfquery name="qQueryChangeColumnName" datasource="#dsn#">
      ALTER TABLE leaderboard
      UPDATE leaderboard SET  points2 = points3
    </cfquery>
    Unfortunately, I get the following error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE statement.
    How can I transfer my data with the alter table method?

    I looked up the Access SQL reference (which is probably a
    good place to start when having issues with Access SQL), and
    it suggests you probably need a WHERE clause in there.
    I agree the documentation is a good place to start. But you should not need a WHERE clause here.
    Too few parameters. Expected 1.
    If you run the SQL directly in Access, what are the results? At the very least, it should provide a more informative error message..

  • How can I minimise data corruption?

    Mac OS X is great, and one of the greatest things it has achieved is an environment so stable that it almost never crashes.
    However, for me the next BIG problem with using computers is data corruption. Data corruption problems bug my life as much now as system freezes/crashes did 5 years ago.
    For some reason, it often seems to be preferences files that become corrupt. I don't know why, or whether other files are becoming corrupt too and I've not discovered it yet. Sometimes I wonder whether it's just because of all the junk I install, or the length of time it's been since doing a clean format. However, with my recent purchase of a Macbook, and within a couple of months having all my preference files becoming corrupt, this goes against those theories. My macbook has minimal amounts of software installed, and is generally kept quite simple.
    Obviously backing up is an important strategy, but that leads to a whole load of decisions like, how often to backup, do you keep incremental backups, do you restore absolutely everything when you discover 1 or 2 corrupt files (how do you know if others have become corrupt?).
    Correct shutting down is something I always do - unless something prevents me from doing so, like power cuts. I've also often had a problem with the sccreen remaining blank after macbook has slept or had the screensaver on. On occasion I've had to hold down the power button to shut it down and get it going again.
    I've looked into uninterruptible power supplies. Unfortunately, the ideal setup with additional battery to provide a few hours of power are very expensive. Also, should the macbook not be immune from problems caused by power fluctuations because of the battery? I certainly did get a system crash recently when there was a power cut - but at the time I just wondered if it was due to the wireless router going off.
    .mac and idisk seem to cause their share of problems. Again, I'm not sure if these are the cause or a consequence of the problems. I have iDisk syncing switched on, and on a few occasions it's vanished and I've had to reboot to get things back to normal. Recently there have been warnings of clashes between .mac and the local idisk.
    Filevault is another possible cause of problems. I've read people advising against it's use. However, if someone is willing to steal my macbook, I don't want that sort of person having access to anything, whether it's address book contacts, calendars, word documents or anything financial. OK, people suggest creating an encrypted disk image, but that doesn't solve the problem of preventing people accessing address book or ical.
    What I'd really like to know is, what are the main causes of data corruption. If I can identify the causes I might be better prepared for trying to prevent it. For example, if 99% of data corruption is due to power fluctuation then I might accept that I need to spend the money on a UPS.
    Once identifying the possible causes, what can be done to prevent them. Would a RAID 1 configuration protect against data corruption, or is it only good in cases of catastrophic drive failure? I've just purchased a 500GB external Firewire 800 drive, which raises the option of creating a RAID 1 with my 2 built in drives.
    Sorry for so many questions, but I just really need to get this sorted. Since moving from OS 9 to OS X this has regularly been my biggest cause of troubles.

    Hi, bilbo_baggins.
    You wrote: "What I'd really like to know is, what are the main causes of data corruption..."You've already identified them, but you seem reluctant to implement the procedures needed to mitigate or avoid those causes that can be mitigated or avoided, in particular:• Power outages or power problems.
    • Improper shutdowns.
    • Hardware problems or failures, e.g. hard drive failures, bad sectors, bad RAM, etc.
    • Bad programming.I can understand your position since:• Not everything one needs to run their computer comes in the box: additional money must be spent.
    • The solutions often seem more complex to implement than they really are. One needs some guidance, which again it does not come in the box, and few books address preventing problems before they occur.Here's my advice:
    1. Implementing a comprehensive Backup and Recovery Solution and using it regularly is essential to assure against data loss in the event of a hard drive failure or other problems. For advice on the backup and recovery solution I employ, see my "Backup and Recovery" FAQ. Using a personal computer without backup and recovery is like driving without auto insurance. Likewise, without a Backup and Recovery solution, you are accepting the risk of potentially losing all of your data at some point.
    2. Perform the little bit of required, regular maintenance: see my "Maintaining Mac OS X" FAQ. It covers my advice on "regular maintenance" and dispels some common "maintenance myths."
    3, If you use a desktop Mac, you need an Uninterruptible Power Supply: power outages and other power problems —surges, spikes, brownouts, etc. — can not only cause data corruption but damage your hardware. I have complete advice on selecting a UPS in the "Protecting Against Power Problems" chapter in my book. Don't simply walk into a store and by the first UPS recommended by a clerk: the UPS needs to be configured and sized to match your computer setup. You don't need hours of battery run time: 10-15 minutes is sufficient to save your work and perform a proper shutdown, or for a modern UPS to perform an automatic shutdown if your computer is running in your absence.
    4. If you regularly "solve" problems by performing a hard restart (pressing and holding the power button or, on Macs so equipped, the restart button), then go back to work without first troubleshooting the cause of the problem, you risk letting a small problem compound into a larger problem. At a minimum, after a hard restart your should:• Run the the Procedure specified in my "Resolving Disk, Permission, and Cache Corruption" FAQ.
    • Then troubleshoot the cause of the problem that led to the hard restart.My book also has an entire chapter on methods for troubleshooting "Freezes and Hangs."
    5. Likewise, hoping that by installing a Mac OS X Update will fix a problem, or simply reinstalling one, without first checking for other problems, can make a bad problem worse. Before installing software updates, you may wish to consider the advice in my "Installing Software Updates" FAQ. Taking the steps therein before installing an update often helps avert problems and gives you a fallback position in case trouble arises.
    6. FileVault does not corrupt data, but it, like any hard drive or disk imge, doesn't respond well to the causes cited above. This is why it is essential to regularly backup your encrypted Home folder using a comprehensive Backup and Recovery solution. FileVault is an "all your eggs in one basket" solution: if bad sectors develop on the hard drive in the area occupied by your encrypted Home folder, you could lose all the data therein without a backup.
    7. RAID: IMO, unless one is running a high-volume transaction server with a 99.999% ("Five Nines") availability requirement, RAID is overkill. For example, unless you're running a bank, a brokerage, or a major e-commerce site, you're probably spending sums of time and money with RAID that could be applied elsewhere.
    RAID is high on the "geek chic" scale, low on the "average user" practicality scale, and high on the "complex to troubleshoot" scale when problems arise. The average user is better served by implementing a comprehensive Backup and Recovery solution and using it regularly.
    8. I don't use .Mac — and hence, don't use an iDisk — so I can't advise you there. However, I suspect that if you're having problems with these, and the causes are unrelated to issues of Apple Server availability, then I'd suspect they are related to the other issues cited above.
    9. You can't completely avoid problems caused by bad programming, but you can minimize the risk by not installing every bit of shareware, freeware, or beta code you read about just to "try it out." Stick to reliable, proven applications — shareware or freeware offerings that are highly rated on sites like MacUpdate and VersionTracker — as well as commercial software from major software houses. LIkewise, a Backup and Recovery solution can help here.
    10. Personal computers today are not much more advanced than automobiles were in the 1920's and '30s: to drive back then, you had to be part mechanic as well as driver. Cars today still require regular maintenance. It's the same with personal computers today: you need to be prepared for troubleshooting them (mechanic) as well as using them (driver). Computer hardware can fail, just as autos can break down, usually at the worst possible moment.
    People whose homes or offices have several Macs, a network, and the other peripherals normally associated with such setups — printers, scanners, etc. — are running their own data centers but don't know it. Educating yourself is helpful: my "Learning About Mac OS X" FAQ has a number of resources that you will find helpful including books, online training, and more. My book focuses exclusively on troubleshooting, with a heavy emphasis on preventing problems before they occur and being prepared for them should they arise.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X
    Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • How to use JDBC Lookup in PI 7.1 ?

    Hi,
    Please advise how to use JDBC lookup in message mapping PI 7.1 ? any reference link / document  ?
    I have followed this step below :
    1. Create the external definition for the database table.
    2. Use the external definition (table) in message mapping JDBC Lookup.
    But the target still "Yellow colour" meanint the mapping hasnot completed yet ? why ? and when i double click the JDBC lookup
    there some error message
    "No suitable parameter found; define new parameter of type 'Channel' first"
    Please advise.
    Thank You and Best Regards
    Fernand

    Hi Fernand,
    JDBC Lookup can be done in PI 7.1 using below mentioned steps :
    1) Create a communication channel between PI and the database to connect to database.
    2) Import the table data as External Definition.
    3) In message mapping where this lookup is to be used select JDBC Lookup under Conversions and map
    4) Double Click on JDBC Lookup
    5) Select parameter and a database table (imported as the external definition). All the elements of the table will appear in the middle column. Select and move the input parameters to the left side column and the output parameters to the right side column. Click OK. 
    6) Under message mapping go to signature tab and define the parameter as channel and category as JDBC Adapter Type. 
    7) Under Operation mapping define the parameter & associate it with parameter defined in Message Mapping.
    Thanks
    Amit

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • How to access JDBC Resource registered in Sun Java System App Server ?

    I want to create a stand-alone JDBC application with Java SE using Swing technologies and JNDI technology. The purpose of using JNDI technology is to avoid change of Java Source Code every time I move the database to different location. This Java application will be used in a standalone PC installed with Windows XP Professional with no LAN / WAN connection. Of course, Internet connection is available with the PC.
    I use JavaDB to store the data tables and the location of the database is D:\E-DRIVE\SAPDEV. Tomorrow, if I move this database to C:\SAPDEV or any network drive, I do not want to change the Java Source code. I want to use JNDI which, if I am not wrong, helps developers to avoid manual change of Java source code whenever the database location is changed. Changes have to be made only in the JNDI Name which contains all relevant information about the database in order to get connection no matter where the database SAPDEV is stored; it can be placed under D:\E-DRIVE directory or C:\ directory of the hard disk. To implement my intention, I started developing Java application as per the steps mentioned below:
    Step 1:
    To proceed, first, I sought the help of Sun Java System Application Server Admin Console. I created JNDI object for Connection Pool using the menu path Common Tasks->Resources->JDBC->Connection Pools.
    JNDI Name : ABAPRPY
    Resource Type : javax.sql.DataSource
    Datasource class : org.apache.derby.jdbc.ClientDataSource
    Description : ABAP Program Repository
    The Connection Pool creation has options for General, Advanced and Additional Settings tabs and I made all the settings relevant to the database I created in D:\E-DRIVE\SAPDEV.
    To confirm whether the above settings are correct, I pressed the Ping push button which is available in the General tab of the connection pool creation screen. The system responded with the message Ping Succeeded.
    Step 2:
    I created a JDBC Resource using the menu path Common Tasks->Resources->JDBC->JDBC Resources.
    JNDI Name : jdbc/SAPDEV
    Pool Name : ABAPRPY
    Description : Database Connection for SAPDEV database
    Status : Enabled
    I can see all the above settings recorded in the domain.xml which is placed in the folder
    C:\Sun\AppServer\domains\domain1\config
    Step 3:
    I have made sure that Sun Java System Application Server is up and running in the background with JavaDB server. I created a Java Program making sure the following JAR files are included in the classpath:
    appserv-admin.jar
    appserv-ee.jar
    appserv-rt.jar
    javaee.jar
    fscontext.jar
    Plus, the lib directory of JDK 1.6 & C:\Sun\AppServer\domains\domain1\config
    Source code of the program is as follows: I used NetBeans IDE to create my project file.
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.naming.*;
    import javax.activation.DataSource;
    public class JNDILookup {
    public static void main(String[] args) {
    try {
    InitialContext initCtx = new InitialContext();
    DataSource ds = (DataSource) initCtx.lookup("java:comp/env/jdbc/sapdev>");
    } catch (NamingException ex) {
    Logger.getLogger(JNDILookup.class.getName()).log(Level.SEVERE, null, ex);
    When I attempted to compile the above program in NetBeans IDE ,no compilation error reported. But while executing the program, I got the following run-time error message:
    SEVERE: null
    javax.naming.NameNotFoundException: No object bound for java:comp/env/jdbc/sapdev> [Root exception is java.lang.NullPointerException]
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:224)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:396)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at SAPConnect.JNDILookup.main(JNDILookup.java:21)
    Caused by: java.lang.NullPointerException
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
    ... 3 more
    Now, I want to come out of this situation; at the same time, I want to preserve the settings I have made in the Sun Java System Application Server Admin Console. That is, I want to programmatically access the data source using Connection Pool created in Sun Java System Application Server Admin Console.
    I request dear forum members to provide me an appropriate solution.
    Thanks and regards,
    K. Rangarajan.

    jay44 wrote:
    Bare in mind I am attempting the context.lookup() from inside the container (my code is in a session bean). I have accessed the server and have my bean "say hello" first to verify the bean works OK, then I call a method with this rather standard code:
    String jndiDataSourceName ="Second_EJB_Module_DataBase";
    Logger.getLogger(DynamicPU.class.getName()).log(Level.INFO,"Programatically acquiring JNDI DataDource: "+ jndiDataSourceName);
    InitialContext ctx;
    try {
    ctx = new InitialContext();
    ds =(DataSource)ctx.lookup("java:comp/env/jdbc/"+jndiDataSourceName);
    } catch (NamingException ex) {
    Logger.getLogger(DynamicPU.class.getName()).log(Level.SEVERE, null, ex);
    return "Exception generated trying to preform JDBC DataSource lookup. \n"+ex.toString();
    But when I run the code the server log shows the initial context is created Ok, but an exception is thrown becasue the resource name is not found:
    (and i have tried vriations of ctx.lookup("jdbc/"+jndiDataSourceName) etc etc
    You are fine here. It works in container because the InitialContext properties have been supplied already. That was the link I forwarded earlier. The InitialContext you create locally needs to locate the container JNDI. That is what the properties specify.
    Where I am confused is where you indicate the stack below is from the server log. So, you initiate a standalone (java main method) application, create an InitialContext, and you see the results in your app server log?
    LDR5010: All ejb(s) of [EJB_Module_1] loaded successfully!
    Programatically acquiring JNDI DataDource: Second_EJB_Module_DataBase
    The log message is null.
    javax.naming.NameNotFoundException: Second_EJB_Module_DataBase not found
    at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
    at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
    at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:192)...
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
    This is strange since I can see this resource (a JDBC connection named Second_EJB_Module_DataBase) is configured on the server from the server's admin console.
    That is why you can obtain a lookup from within the container (app server).
    For this lookup to work it may be that one must map the name inside an ejb-jar.xml deployed with the application, but I have also read some resources like jdbc connection should have a default name. Does anyone know if my lookup() should work without using an ejb-jar.xml mfile to explcitly map the reource for my application?
    Both EBJ's and data sources can be referenced via JNDI. It's a remote lookup (that is normally optimized if it is running in the same JVM). You should not have any dependencies on a JDBC data source being set-up on ejb-jar.xml. That file can of course impact your EJB's. However, data sources are normally set-up on a container-specific basis (e.g., you probably did it through a console, but there is a spec somewhere about how to set up a data source via a resource the app server looks for; it varies from app server to app server). However, once you have that container-specific data source set-up, JNDI operates vendor-neutral. You should be able to take the code above and move it to JBoss or Weblogic or Tomcat or whatever (this is an ideal, in practice, the vendors sometimes put a data source in a name you would not expect, but again, you can use their JMX console to see what the JNDI name is).
    (As I stated above if I have to use a deployment discriptor to get at this JNDI datasource, then solution is not "programmatic" as newly configured datasources could not be accessed without redeploying the entire application).
    As JSchell alluded to, you will always have at least something vendor-specific. JNDI itself (the code you wrote) is totally portable. However, you have to set the various JNDI environment properties to a given vendor's spec. Ideally, you should not need a vendor's actual InitialContext application, but it's a possibility. Once you can safely cast to Context, you should be vendor-neutral (if not, demand your money back).
    So that is exactly where I am stuck, trying to get the lookup to work and wondering if it should work without and xml file mapping the resource for my app.
    What we ended up doing for standalone was to provide our own JNDI. If you look at the open source project JOTM, there are examples on how to use that with XBean (if integrating with Spring, as we did), you can easily set up a data source that runs standalone exactly as you get in the container. Another benefit is you get full JTA/JTS support and the ability to run XA transactions. (This might all be alphabet soup, but the app server gives it to you, and this is the way we ended up doing the same: JNDI + JTA + JTS + XA). It ends up the same application code uses a "vanilla" InitialContext and all we have to do is write one or two xml files (one for our app server, a couple for JOTM), and our actual code works the same.
    I still think you have a shot at getting to the container's JNDI, just not using their full-blown app server JAR.
    I think there must be a simple way to do this with an ejb-jar.xml, I am no expert in JNDI, I could be missing something simple, I will keep at it and post an answer here if I come up with it.
    Thanks, jayIt is simple to code. Getting it to integrate with your app server, yes, that can be challenging. But it has nothing to do with EJB's. Write a simple test. Using nothing but DataSource and InitialContext. Let us know where you get stuck.
    - Saish

  • How to handle sensitive data in BI?

    Hi there,
    we are about to load data from HR into BI. The authorities according to the queries and InfoProviders are lowered to a minimum so that only a group of people has access to those sensitive data.
    But what about the generated tables in which the data of the InfoProviders are stored? Some people are granted to use SE16 (e.g. the basis team). How is it possible to protect the data from being reviewed without changing the authorities of the basis team.
    Thanks in advance
    Dennis

    Hi Dennis,
    Q.How is it possible to protect the data from being reviewed without changing the authorities of the basis team.
    If you do not want to change the authorities provided to the basis team then you will have to opt for the data in the table to be scrambled so that on displaying the information is not meaningful.
    Not aware, if there could be other options.
    Thanks,
    Saby..

  • How to install JDBC 8.1.6???

    Could someone tell me how to install the Oracle JDBC drivers
    ver 8.1.6?
    The compiled FAQs at
    http://technet.oracle.com/tech/java/access/info/jdbc_faq.htm
    are great, but offer no insight on how to install JDBC.
    Is there info on the web site about it other than
    the following very old still unsolved problem below:
    Product: JDBC
    Report Number: 654140
    Last Updated: 09-APR-98
    Component: JDBC Version: 7.3.4
    RDBMS Version: 0
    Operating System: MS Windows NT Version 4
    Affects: All supported platforms.
    Please update the kittings of the JDBC drivers found on
    www-aurora and the
    external FTP sites. These kittings of the JDBC Drivers say "Use
    the Oracle
    Installer" causing customers to call in immediately after
    downloading it and
    asking "How do I install it???"
    Also, the internal copies of the drivers' documentations say the
    same things
    and they do not have .PRD files for an Oracle Installer either.
    When an
    internal employee downloads this he goes to the main page on
    Aurora and sees
    to call into Oracle Support for any questions on JDBC, and this
    causes
    even more unnecessary calls from Oracle Employees that could have
    easily
    been advoided.
    Status:
    Open. More information may be available at a later date.
    null

    That is quite impossible to give you an aswer. We have to few information. For example, when did you get the error message? Is there an associate error number with this message? Try to explain what you did.
    Bye, Aron

Maybe you are looking for

  • Alpha channel in initial video

    whether i am using premier or final cut, exactly how would i encode and save an alpha channel (to use in flash) in my video before i import the video into the flash video encoder. what setting(s) do i use in these programs? i am shooting the video wi

  • Adding users using XML

    The examples for adding users to iFS work fine, but do I have to create an XML file for every user I want to add? I tried to create an XML file with more than one <SimpleUser> definitions, but iFS reports an "unexpected end of file" error at the posi

  • Need to find Video Effect Button cuz its not in Inspector

    In my iMovie 11 i have audio effect instead of video effects in the inspector. i don't know how to change it/ or find video effects button. Help? thanks

  • My moving square leaving the boundaries of the panel is not noticed by Java

    Could someone please tell me why neither System.out.println("Out of bounds!") nor JOptionPane.showMessageDialog(null, "Out of bounds!") get reached? Here is the code: import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.

  • Js link for sharepoint xslt dataview :

    Hi, I am using js links for changing a field into anchor type in my list. This is working fine. But when i drop that list data view into a xslt data view to display my js link does not fire. Please let me know if i can also attach my js link with xsl