Dynamic url and jdbc for entity class

Hi all,...
I want to create a data aware program by using netbeans 6.0.
So that open a contextual menu in projects section, and simply add a new 'Master/Detail Sample Form'.
The IDE than ask me about the connection (jdbc driver, url etc) and table name I will use in the form.
It's work as expected.
But, the jdbc configuration can't be changed anymore, it's fixedly saved in persistence.xml.
That's the problem. I want to make an application that can connect to differences database (with same structure), so that my program can use oracle, mysql or others as user wish (The user should fill the jdbc connection property whenever the program executed).
How's the solution? should I back to primitive jdbc connection by using 'Statement'?
Thanks in advance

JNDI is a naming service used when you are deployed (typically) in a J2EE container such as Tomcat or JBoss. Your application is desktop right now, but you mention that you want to deploy it on your intranet? My guess is that you mean right now your database is on your machine, and you are connecting to that via localhost, and that the application will remain a desktop one.
Where you put the database should not be an issue. If you can see the machine on your network, you should be able to connect with JDBC. Simply substitute the IP or host name where the database resides. I did a quick look at Hibernate's documentation, and it appears you can configure the data sources used for their flavor of JPA dynamically.
There is an example of how to programatically create an Entity Manager in Sec 2.2 of this page http://docs.jboss.org/hibernate/stable/entitymanager/reference/en/html_single/#setup-configuration.
- Saish

Similar Messages

  • Dynamic generation of .cex for window classes

    subject :dynamic generation of .cex for window classes:
    Hi,
    I want to generate windows classes (cex export file) with tool
    code. I don't have any problem with non windows attributes.
    But I can't generate windows attributes: the export file contains a
    serialized object but I don't know which object.
    thank you for your help.
    Corinne
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    value="Button_#{myBean.id}"This is perfectly valid syntax.
    But you're talking about "dynamic generation of IDs". Don't you instead mean something like:
    id="Button_#{myBean.id}"?
    If so, then yes, using EL in the ID attribute is prohibited. Also see the TLDDOC [1]. Why do you want to do it anyway? The f:attribute might be more useful for you [2].
    [1] http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/
    [2] http://balusc.blogspot.com/2006/06/communication-in-jsf.html

  • What is the field and Table for "Batch Class" and "Class Type" in QM.

    Hi All,
    What is the field and Table for "Batch Class" and "Class Type" in QM.
    Thanks,

    Hi,
      For batch class the class type value is '023' . This you can find from KLAH table and the fileld for class type is KLART..
    And also all the data related to batch class are found in tables INOB, KLAH,KKSK and for the characeteristics of batch materials you can refer AUSP table.
    In INOB table, for batch class, you need to give 023 in KLART field and  value MCH1 in OBTAB filed.
    Please check this and let me know if this you need any more details?

  • Own LR need LR,Bridge and PS for a class will a new upload effect existing LR?

    HELP please I own LR already don't really want to pay for it again, also concerned with a new Software interfering with existing......but need Bridge and PS for a class...thoughts?

    Moving this discussion to the Adobe Creative Cloud forum.
    Kawachinagano I am sorry you are facing difficulty submitting your redemption code.  Please see Redemption Code Help for information on how to redeem your redemption code for your membership.

  • Java Message Mapping : Dynamic FileName and Directory for ASMA

    How to Put Dynamic FileName and Directory for ASMA Properties of File Receiver adapter in Java Message Mapping ???
    I know How to Do this in UDF , But In Java Type Message Mapping . How to do this ????
    Regards
    PS.

    Hi
    chk this:
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=95093307
    Thanks
    Amit

  • How could I set the proxy settings for just some URLs and not for all?

    Hello,
    I am using HttpURLConnection to establish a HTTP connection . The connection pass through a proxy, and it requires security.
    I know that I can set the proxy settings in the system properties, and this works perfect.
    But I don't want to set the proxy settings in the system properties, because this proxy settings will be for ALL the URLs, and I just want for a few URLs.
    How could I set the proxy settings for just some URLs and not for all?
    Thanks

    java.net.URL.openConnection(java.net.Proxy proxy)
    @since 1.5

  • WCF-WebHttp dynamic URL and Dynamic Header/Behavior configuration.

    HI,
    I have an requirement to integrate with the REST Services in BizTalk Server 2013 R2, And This REST Service URL and HTTP Headers will differs per message. So I had created an Orchestration with the Dynamic Request-Response port and assign the properties in
    Message Assignment Shape. However while testing HTTP Headers were not added to service request message.
    I had tried with create Custom endpoint behaviour and assigned this behaviour to service request in Orchestration, however this property also not assigned from the Orchestration.
    Is this a bug for WCF-WebHttp Adapter? Is any other options to achieve my requirement?
    Thanks,
    Raj
    Praveen

    Hi Praveen,
    Its a known bug already
    reported to Microsoft. 
    BizTalk 2013 servers that have been upgraded from BizTalk 2010 are missing
    some of the new global properties including HttpHeaders properties because
    of this even in orchestration we cannot change the HttpHeaders on messages.
    As a workaround WCF behavior extension
    can be used to solve this problem.
    Which can be downloaded from here.
    For the detailed explanation, I would adivce you to follow the below link on how to dynamically change
    the WCF-HttpHeaders for WCF-WebHTTP adapter.
    Dynamic
    WCF-HttpHeaders for WCF WebHttp adapter
    There is already a discussion going on around this on another post. Ashwin has also recommend to use custom pipeline component as a work around .
    Refer: BizTalk WCF-WebHttp Custom Headers per message
    Rachit
    Please mark as answer or vote as helpful if my reply does

  • URL and PORT for SOAP SENDER request

    Hi
    according to SAP doc the URL to SOAP SENDER request is:
    http://IP:PORT/XISOAPAdapter/MessageServlet?channel=:SERVICE:SOAPCOMMCHANNEL
    Where do I find the IP and the PORT to use?
    br

    Hi,
    The IP is of your XI System.
    PORT number depends on the instance number. Usually it is 00 for default instance (then port no will be 8000). click on propose URL and you will get it.
    Also you can go to SMICM transaction in your XI system and choose Goto-> HTTPS Server->Display data to get the port no.
    Regards,
    Jitender

  • Sqlj and jdbc for linux

    Hi All,
    I am currently set up the (tomcat) jsp engine on top of apache web server.
    And now i would like to install both sqlj and a jdbc driver such
    that I can query our oracle database. In all of the options for downloads
    there is a windoze option and a solaris option. Do I have to wait for specific
    "linux" version to get them to work. Or is the solaris option alright
    for linux ??
    slightly confused,
    Chris

    Unfortunately, this description is still rather unspecific.
    It sounds, as if there might be an issue with the way database connections are established for the SQLJ and JDBC parts of your program. Could you provide more information on that, specifically on how you obtain JDBC connections and SQLJ connection contexts.

  • FM/BAPI for assigning a class and value for the class instead of manually d

    Hi guys,
    Instead of manually adding equipment class and assigning value for the class added can i get a FM or BAPI.
    this is for transaction IE02.
    rewards will be given.

    Hi
    I hope this thread can help you
    Characteristic Value
    Re: Equipment Characteristic Value
    Change Equipment Using Transaction IE02
    Regards
    pavan

  • Help needed to figure out URL and username for the LDAP server

    Given that LDAP directory parameters as follows, how can i identify the exact parameters to be used in my LDAP service access Java code. Im using JNDI to access a LDAP server given by an Ip address (say, 10.1.1.20) and the port number (say, 389)
    Given: -D "cn=mycn,ou=mystaff,o=myorg,dc=test,dc=my,dc=org" -w secret
    Heres my sample Java code
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, "<URL>");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, "<PRINCIPAL>");
    env.put(Context.SECURITY_CREDENTIALS, "secret");
    ctx = new InitialDirContext(env);
    SearchControls controls = new SearchControls();
    controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
    results = ctx.search("ou=mystaff,o=myorg", null);Could any one please help me to recognize what will be the values to be comes to URL, and PRINCIPAL , so that i can search all the objects inside "ou"
    Note: Actually i tried several times, bt i was getting "Invalid Credentials" exception.. i doubt that is because the URL or the user name i gave was not syntactically correct. Thats y i need to verify with you all.
    Thanks in advance
    Saj

    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, "<URL>");env.put(Context.PROVIDER_URL, "ldap://10.1.1.20:389");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, "<PRINCIPAL>");env.put(Context.SECURITY_PRINCIPAL, "cn=mycn,ou=mystaff,o=myorg,dc=test,dc=my,dc=org");
    env.put(Context.SECURITY_CREDENTIALS, "secret");
    ctx = new InitialDirContext(env);
    SearchControls controls = new SearchControls();
    controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
    results = ctx.search("ou=mystaff,o=myorg", null);

  • Dynamic Host and Port for Web Proxy

    hi,
    When I create a web proxy in JDev I supply the hostname and the port for the web service. The code is then compiled and then deployed. However I want the host and port to be dynamic (kept in a varaible) so when I move my deployment from Development to Test server I just need to change a value in a database or text file. I don't want to re-compile and deploy the code when I move servers. Is there any way to do this??
    Thanks
    Stephen

    Hi,
    not so in the WSDL file that is created. If from the client side access, then WS poxy classes allow you to do this
    Frank

  • Combining LVOOP DVR with Asynchronous Dynamic Dispatch and Preserve Run-Time Class

    OK, the title sounds like a cornucopia of LVOOP terms.  But there's a reason.  This is in a way an extension of THIS thread.
    What I'm doing recently is creating a LVOOP approach to loading Completely Asynchronous UI elements into subpanels.  This I have combined with a global repository for the objects (which are essentially singletons with a UI functionality) which are shared via DVR, thus eliminating a lot of synchronisation headaches).
    This means that I can ahve a universal framework for launching the UI elements into a subpanel.  The changes made on the Object there are automatically reflected in the global repository.
    So far so good.
    What I don't like too much is a combination of two seemingly awkward code constructs I need in order to keep things running.
    Weird construct 1:
    I have defined a "Launch UI" function in my parent class which is Dynamic Dispatch (Allowing each object to take care of launching its own UI).  This takes a parent object DVR as a second input which I make sure is of the exact same type as the object type being invoked by using the code shown below.  The ACTUAL Type of both inputs to the launch VI within the IPE are identical.  This is guaranteed because I require each new class to override this function.
    Here I pass the DVR from outside the IPE to the "Launch" VI but the Object obtained within the IPE retains information required for DD thus ensuring that the VI called for launching the UI is identical to the ACTUAL object type in the DVR.  This works OK and by placing this weird construct WITHIN the parent class, abuse is minimised, it works fine and seems to have no major side-effects.
    So now we have a VI running asynchronously in the background which belongs to a specific object but has a DVR which it *thinks* is of a Parent Type but, because of the steps taken earlier, is actually of the same type as the object itself.
    In order to make use of the functionality defined in this actual object type, I need to continuously re-interpret the Object within the IPE as shown below.  Otherwise only the Parent functionality is available.
    If I am accessing only methods of the parent class, then the Preserve functionality is not needed.
    Is there a more elegant way to do this?  I find the net result of this code and type-juggling to be really useful and much easier to manage than the non-DVR route since the synchronisation issues disappear.  By making the IPE usage near-atomic we remove the chances of deadlock.
    All editing done in the UI of the asynchronous VI is reflected automatically in any subsequent usage of the DVR.  Even if the DVRs are not shared between VIs, this makes (for me) the headache of synchronisation easier.  If you start expanding this beyond the limits of a single VI, the benefits in Synchronisation become really huge.  You can even have multiple UI objects operating on the same data in the background without extra synchronisation needs.  The only synchronisation required is a global "Data updated" for the object in question whereby the UI elements simply update their indicators and controls from the DVR again.  This is trivial.
    Thus I am convinced that the net result of this is very beneficial.
    My question is if there's a better, safer or more "official" way to do this?
    I was about to start a new Idea for combining the "Preserve Run time Class" and the DVR Terminal of the IPE so that the casting is done automatically.  We could then have a double input to the IPE, the DVR (of base type) plus the ACTUAL Type of the object but of course returning an error if the types are incompatible.  It would be like an "Imposter" DVR input for the IPE which allows a re-interpretation of the object type.
    Would all of this go away if we allowed Dynamic Dispatch to work with DVRs?  Probably.
    Shane
    Say hello to my little friend.
    RFC 2323 FHE-Compliant
    Solved!
    Go to Solution.

    You guys rock!
    I didn't even think of casting the DVR like that.  Kinds stupid of me but I never would have thought it would work.  Cool.
    Also, Yeah, the limitation of no IPE in the Launch VI was one I spotted quite early on.  this is why my Launch VI also doesn't accept more data than is absolutely neccessara because a DVR access in that VI will of course cause a lockup.  I have the system so far now that I can have a SINGLE Launch VI (Which is NOT overridden, so the limitation refers to only a single VI now which is certainly better.
    So again guys, thanks for helping out an old newbie.  I've been around for quite a while, have made many posts but I love the way I just keep learning from others in the Forum.  This is just why I absolutely LOVE it here. 
    Shane.
    Say hello to my little friend.
    RFC 2323 FHE-Compliant

  • Defaulting dynamic attributes and weightings for BID INVITATION

    Hi Friends
    I have a task at hand to default the dynamic attributes( some custom defined fields for the bidder) for bid invitation.
    Can anyone help me with this?
    Thanks in Advance
    Regards

    Hi Ankur,
    I assume you are looking for attributes automatically populated, when a user
    creates a bid invitation. Did you try to work with a template and define the
    bid invitation in the way required and create a bid invitation based on the template?
    Another option is to define the attributes for well defined categories and let the
    users use the "propose" button.
    Thanks,
    Claudia

  • Data Slice dynamic activation and deactivation for a set of users

    Hi Experts,
                     We have requirement to manually enter the data into RTC using IP.
    There are 2 sets of users --> Power Users and Normal Users.
    We need to allow the normal users to enter the data only from 1st to 5 th working day of every  month.
    Power Users should have authorization to edit and enter the data at any time.
    Can any one suggest how to set the dataslice using code.
    Regards,
    Shashi

    Hi.
    Please note that update of RSPLS_DS table do not affects at RUNTIME.
    If you want to create dataslice that activated and deactivated within sequence run you should do the next:
    1. Create exit variable that return you all working days EXCEPT 1 to 5 of each month.
    2. Create dataslice in modeler on this characteristic with restriction by this exit variable.
    3. This dataslice should be based on ABAP class as described [here|https://www.box.net/shared/zhirrvk859].
    4. In mydataslice method enter following code (I assume you have any DSO with definition whether user is power user or not. Lets say DSO has next structure:
    USER   | Z_IS_POWER   |
    aaaa    | NO
    bbbb    | YES
    Enter the next code in mydataslice method:
    SELECT Z_IS_POWER FROM YOURDSO INTO lv_POWER WHERE USER=sy-uname.
    IF sy-subrc = 0. *This is SUPER USER. Allow locked data edition
    e_noinput = rs_c_false.
    ELSE. *This is regular user. Do not allo locked data edition
    e_noinput = rs_c_true.
    5. Create in modeler 2 planning sequences for activating and deactivation dataslice as described in document.
    6. Each time you want to do something with locked data run first sequence for deactivation of dataslice. If super user will run it so dataslice will be deactivated, but if regular user - dataslice will lock the data.
    Regards.

Maybe you are looking for