Swing adf set db credential from java

Hi!
I wrote a program on Swing adf using standart JDeveloper jdbc connection.
Now I whant install my programm to client. But jdbc url with credential store in standart adf xml configuration files.
I whant that than user start programm first them input connection attributes ( host,sid,user,password), and then programm initilize all View and Control.
I I was searching answer in google,forums.oracle.com, jdeveloper books and not found answer.
But problem often is repeated, I think answer must be included into JDeveloper help book.
My main method with init context
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception exemp) {
exemp.printStackTrace();
try {
JUMetaObjectManager.setErrorHandler(new JUErrorHandlerDlg());
JUMetaObjectManager mgr = JUMetaObjectManager.getJUMom();
mgr.setJClientDefFactory(null);
BindingContext ctx = new BindingContext();
HashMap map = new HashMap(4);
mgr.loadCpx("view.DataBindings.cpx", map);
final FormMain frame = new FormMain();
frame.setBindingContext(ctx);
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = frame.getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
frame.setVisible(true);
} catch (Exception ex) {
JUMetaObjectManager.reportException(null, ex, true);
System.exit(1);
}

May be anybody know how to create configuration on java for swinf ADF, without xml files?

Similar Messages

  • How to set iframe src from java dynammically

    Hi,
    Iam calling a servlet from jsp and servlet calls the databse query and returns the value,
    in my jsp i have ifrme, i want to change the source of iframe from java depends on the result from database , and the result must display on the iframe can any one tell me how to do this

    aurelian_cl wrote:
    I need to know how to set environment variables from java
    I want to set from java for example the environment variable "TestVar" with the value "TestValue"!1) That functionality does not belong in an application. You're trying to set environment variables, which are global across all applications, at either the user level as a whole, or across the entire machine (system level). Or, if you're only trying to set a variable active for the current process, you don't need to do that.
    2) Environment variables are not a platform-independent entity, and are thus against the nature of Java.
    My gut feel is that you are designing something in a backwards way, so my point is mainly to point that out, not to try to help you solve that particular problem.

  • Swing ADF - New transaction in a java panel.

    How can I create a new ADF Transaction (session/unit of work/ independant dataset) within a panel?
    I have two issues that I'm trying to resolve:
    1) I already have a framework that I need to use, so I cannot use the defaultly created ADF JFrames or InternalFrames. I need all the plumbing (both single window/panel and multi-window/panel views) to exist in panels so they can be properly embedded into the existing framework. I'm not sure how to seperate the frame from the ADF logic or how to start from an empty class and add the needed plumbing.
    2) I need a new panel to be created under a tabset when the user initiates an action. This by itself is simple enough, the issue is in dynamically creating a new transaction per tab that is created so that each tab can be committed/rollbacked independently. The user may hop around between tabs and open/close them in random orders.
    Thank you of any help and insight you can offer,
    SMartel

    bump.

  • How can I set system date from java code?

    Hi. I need to set the system date from my application. It must works on Windows7 so the "cmd /C date" must be executed with Administrator privileges.
    I tried do it that
    Process p = rt.exec("runas /user:" + env.get("COMPUTERNAME") + "\\Administrator \"cmd /C date " + dateYYYYMMDD + "\"");
    Then process ask me for password for administrator but it terminates befor i send it. exitCode() returns 1.
    Have you some idea how can I do it?
    Regards for you.

    At the very least, you need to read this and follow the advice it gives. That may or may not solve your problem, but it's a bare minimum.
    http://www.javaworld.com/jw-12-2000/jw-1229-traps.html

  • Setting "model" attribute from java

    Hi!
    I want to write this uix code in java:
    <                                                  <table model="${bindings.DepartmentsView1}">
                                                           <contents>
                                       <column>                                                            
                                                                     <columnHeader>ss                                                                      
                                                                     </columnHeader>
                                                                     <contents>
                                                                          <textInput>                                                                           
                                                                          </textInput>
                                                                     </contents>
                                                                </column>
                                                           </contents>
                                                      </table>
    Can anybody tell me what should i write here?
                   table.setAttributeValue(table.MODEL_ATTR,???);
    ??? = ${bindings.DepartmentsView1}
    Thanx in advance: Gabor Nyerges

    setting the model attribute in java is not supported.
    The model attribute is a parse time property. At parse time it is resolved to individually bind the "real" properties.

  • How to set classpath from java class ??

    I have tried to use System.setProperty("java.class.path", "my class path string ") to set classpath dynamically. But it is not working. How to set it dynamically from java class ?? Thanks , gary

    Look into the java.net.URLClassLoader. You can't set the classpath after the fact but you can specify URL's that will checked when you try to load a class with that loader.

  • Set classpath from java code

    Hi,
    Is it possible to set new classpath from java code? Something like System.setClasspath(String);
    Many thanks
    Miso

    You aren't the first one to wonder whether that would work, so don't call yourself stupid on that account.
    Not taking 15 minutes to set up and run a test to actually see if it works... well, if you really needed the answer, that would be different.

  • Setting windows environment variables from Java program

    Is there any way to set environment variables from Java program in Windows? Any help is appreciated.
    Here is my situation:
    I need to decrypt an encrypted Oracle user password in a batch file which will be used while running a sql script with sqlplus. I was planning to have bat file which will call a Java program decrypt the password and set it as an env variable in windows which will be available while calling sqlplus.
    thanks

    Runtime.exec has a lot of overloadings. Two of them
    allows you to specify the environment variables.
    exec
    public Process exec(String[] cmdarray,
    String[] envp,
    File dir)
    throws IOExceptionExecutes the specified command and
    arguments in a separate process with the specified
    environment and working directory.
    cmdarray - array containing the command to call and
    its arguments.
    envp - array of strings, each element of which has
    environment variable settings in format name=value.
    dir - the working directory of the subprocess, or null
    if the subprocess should inherit the working directory
    of the current process.
    I had this sample program:
    public class SetVarExample {
    public static void main (String[] args) throws Exception {
         String[] cmd_env= new String[] {"password="+"ABCD","Path=C:\\Sun\\AppServer\\jdk\\bin"};
         String cmd = "cmd /c SET ";
         Runtime.getRuntime().exec(cmd,cmd_env);
    System.out.println( "Finish ...." );
    I tried it in a command prompt. But looks like when the program exits, it's a whole new process and so it does not retain the env variables set in the java program.
    Any suggestions? Am I doing it worng?
    thanks

  • Possible to set Dynamic Config from ABAP Proxy

    Hi,
    I know how to get and set Dynamic Config from Java/XSLT mappings and adapter modules. But I want to do this from an outbound ABAP Proxy Call (in the same way I can set the serialization context for EOIO), is that possible?
    The scenario is: I have an interface; Proxy -> Xi -> ftp, with no mapping. It seems unnecessary to introduce a mapping just to set some dynamic config values for the receiving adapter which are already known at the outbound proxy call...
    rgds Johan

    Hi Bhavesh,
    In the thread you mention it is shown that you can set Dynamic Config properties during an ABAP mapping. My question was if I can set these properties already in the proxy call? Or did I miss something?
    Of-course I can introduce a dummy mapping in Java/XSLT/ABAP which copies the source message to the result message and sets the dynamic config properties, but I would rather not introduce a mapping if not neccessary...
    rgds Johan

  • Opening ADF page from java script

    I am trying to use window.open(url, winName) to open an ADF page from java script.
    I have set the same winName but when i call the window.open method every time it opens up a new window.
    The code is as below:
    <html>
    <head>
    </head>
    <body>
    <script>
    function openwin() {
    window.open("about:blank", "winDocPrint", "width=800,height=600,location=no");
    </script>
    <form action="http://127.0.0.1:7101/RegionRefresh-ViewController-context-root/faces/EnterAndDisplay?_afrLoop=3611588465186&_afrWindowMode=0&_adf.ctrl-state=zoaas2mc3_4" target="winDocPrint" onsubmit="openwin">
    <input type="submit" value="Print Comments Call ADF">
    </form>
    </body>
    </html>
    when I click the button first time, it opens a new window, and keeps opening a new windows on clicking the button again.
    I want it to use the same window that was opened first time.
    Any help would be appreciated.
    Thanks,
    Sandeep M.
    Edited by: user8895611 on Mar 25, 2010 11:44 PM

    Hi,
    you need to keep the window handle reference so you can access the same window
    http://www.irt.org/script/874.htm
    Frank

  • About dll from java swing

    Hi,
    I hava class (send sms from java) in dll - ActiveXComponent type, his name: SMSCom
    dll name: SMSSender
    that get in his constractor: (in VB I wrote this)
    SMSObj.password = password;
    SMSObj.Username = user;
    SMSObj.Source = phone;with this code I'm connect to the dll file and his object, but
    I don't know how to give this object this parameters.
    ActiveXComponent ax = new ActiveXComponent("SMSCom.SMSSender");
    Dispatch SMSObj = (Dispatch) ax.getObject();Thanks alot for any help :)

    Thank you so moch, you helped me alot!!!!!
    I you coul'd help me with last little thing I'll be happy:
    but I have error, it is not attached to your help, the error link to this line
    (I have jacob.dll +jacob.jar)
    ActiveXComponent ax = new ActiveXComponent("SMSCom.SMSSender");the error messege:
    Exception occurred during event dispatching:
    com.jacob.com.ComFailException: Can't get object clsid from progid
         at com.jacob.com.Dispatch.createInstance(Native Method)
         at com.jacob.com.Dispatch.<init>(Dispatch.java)
         at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java)
         at com.matarotqm.QM6.model.Test1.<init>(SmsDll.java:51)
         at com.matarotqm.QM6.model.SmsDll.<init>(SmsDll.java:27)
         at com.matarotqm.QM6.view.Sms.actionPerformed(Sms.java:273)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.Dialog$1.run(Unknown Source)
         at java.awt.Dialog$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Dialog.show(Unknown Source)
         at java.awt.Component.show(Unknown Source)
         at java.awt.Component.setVisible(Unknown Source)
    I have in this object (SMSObj) method that I have to set her text as String and phone as String.
    do I call method from SMSObj like this?
    System.out.println("Calling method..");
    Dispatch.call(SMSObj,"SendSMS","Hello From Java","0507657661");

  • I just downloaded and instaled firefox 4. Now, everytime I institute a command I get a po[p-up from Java script that tells me to uninstal set. I cannot go on untin I press ok and then I am good for one more command and it starts with the pop-up again.

    I'm not even sure if this is an extension or plug-in and all I can tell you is what I have already stated. I can only make one command at a time and after each one I get a pop-up from Java script that says uninstal set. I must depress ok to move on, but only for one more command and it starts over again. This also happened when I tried to instal firefox 4 a couple months ago and I deleted the program and went back to an earlier version.

    Mail troubleshooting - Yosemite
    Troubleshooting sending and receiving email messages
    Troubleshooting sending email messages
    SMTP servers keep going offline

  • Viewing and printing a PDF file from Java Swing Application

    Hello,
    I need to view and print PDF files from Java Swing Application.How do I do that?I appreciate your help.
    Thank you
    Sumana Somareddy

    If you have a link to the URL pointing to the PDF file, you can allow the browser to open it. Then use the print function of the browser to print the PDF document.
    Regards,
    Tak.

  • How i can set dropDown item to 6th item from java code ?

    Hi
    Thank you for reading my post.
    how i can set dropDown item to 6th item from java code ?
    i have the value field of database and i can use it to set selected item of DropDown.
    so : can i use value field to set the selected item ?
    Thank u.

    Hi,
    Please go through the following thread which discusses about setting teh selected item for a dropdown:
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=50697
    Hope it helps
    Cheers
    Giri

  • Setting Theme's Max Whole Image Level from Java

    Hi,
    I'm using JDeveloper11g and I have problems with predefined themes.
    I have developed an application which shows a predefined theme through the <dvt:predefinedTheme> component.
    Because there too many FOIs , I want to set the "Max Whole Image Level" for the theme.
    I know it' is possible from Javascript with function "setMaxWholeImageLevel".
    Is it possible from Java too?
    In Java I have instances of classes UIGeoMap and ThemeFOI, but I don't find methods to set the "Max Whole Image Level" for the theme.
    How can I do it?
    I tried another method too. I put an <af:clientListener> component to listen to page loading. So when page load event fires, a javascript method calls the "setMaxWholeImageLevel" function. The problem is that when page load fires, the object MVThemeBasedFOI (returned from object MVMapView) is null.
    This is the javascript code:
    function test()
    var mapView = null;
    var theme = null;
    var geoMap = AdfPage.PAGE.findComponent('map1');
    mapView = geoMap.getMVMapView();
    if(mapView != null)
    theme = mapView.getThemeBasedFOI('predefinedTheme1');
    if(theme != null)
    theme.setMaxWholeImageLevel(11);
    theme.setMinClickableZoomLevel(11);
    What can I do?
    However, do you know if Java functions, setting "Max Whole Image Level" parameter, will be implemented?
    Thank you,
    Arturo

    Hi,
    I have found a solution for my problem.
    If I call Javascript from backing bean, it works well.
    I have inserted the calling to javascript function test() in method setMap1():
    public void setMap1(UIGeoMap map1)
    this.map1 = map1;
    if(map1 != null)
    ThemeFOI theme = map1.getThemeFOIById("predefinedTheme1");
    if(theme != null)
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExtendedRenderKitService service = (ExtendedRenderKitService)Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
    service.addScript(facesContext, "test();");
    However I have these questions:
    1) What is the best method to work? Is this method better than using an <af:clientListener> component listening to page loading ?
    2) In the next release of JDeveloper, will it be possible to set a predefined theme as a "whole image" from Java ?
    Thank you,
    Arturo

Maybe you are looking for

  • Error when running a report in Crystal Reports Server 2008

    Received the following error message: Error in File Relatorio4: Failed to load database information. Or Error Failed to open the connection. Relatorio4 Details: [Database Vendor Code: 12154 ] I'm trying to run a report Crystal Reports 2008 in Crystal

  • Why does my iPad only charge from my Macbook?

    I have the origional ipad (it does what I need so I don't see the point in upgrading) it has worked fine since I got it. However recently a bizzare bug has appeared, it will only charge when plugged into my 2012 macbook pro but when I plug it into th

  • Using PL/SQL Block how do you check if the character string value is aA-zZ

    I have a pl/sql block that I prompt the user for password and I load the string into an array and interrogate each index(entry) to see if it is "aA-zZ". How can I check if the value entered is Alpha. I need to do the same for number and Special chara

  • Delete row in database table

    Hi! Is there a way to delete row in database table by telling the number of the row? Thanx!

  • Crash during download; now can't download

    I signed up for match; "matched" all of my music. decided to follow the gizmodo guide and delete my lower-res files and then download the higher res apple versions. My itunes crashed halfway through the process, saying it "didn't have enough memory"