How to connect using weblogic java

I need to use JAVA to connect to WebLogic and collect information from data source. Could someone - paste example code?

Hello

The exception is due to jndi.properties not in classpath when you run stand-alone classes, you must make sure that it is in the class path when running outside the container.

Here's the code to provide credentials and get all data sources:

Hashtable ht = new Hashtable(); 

//Sets login credentials
ht.put(javax.naming.Context.SECURITY_PRINCIPAL, "weblogic");
ht.put(javax.naming.Context.SECURITY_CREDENTIALS, "weblogic1");

ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://localhost:7001");

try {
    InitialContext initialContext = new InitialContext();

    //List all data sources
    NamingEnumeration ne = initialContext.list("jdbc/");
    while (ne.hasMore()){
     NameClassPair nameClassPair = (NameClassPair)ne.nextElement();
     System.out.println("Data Source Name   " + nameClassPair.getName());
    }
}catch (NamingException ne) {
    ne.printStackTrace();
}    

Jean Lou

Tags: Java

Similar Questions

  • How to connect to weblogic?

    I have an ADF web applicaton that contains 2 projects, model-ViewController.
    I create another project named Build and it has an xml file, ojdeploy - build.xml.
    However, how to connect to the domain of weblogic in ojdeploy - build.xml?

    -ojdeploy - build.xml.
    <? XML version = "1.0" encoding = "US-ASCII"? >

    <!-sets the default settings for any deployment tasks.
    Also defines some variables strictly for use in this file
    in macros
    ->
    < ojdeploy-construction >
    < deployment >
    < parameter name = "workspace" value="E:\SOAworkspace\otnapp\otnapp.jws"/ >
    < name of the parameter = value "profile" = "*" / >
    < name of the parameter = "nocompile" value = "true" / >
    < name of the parameter = "nodatasources" value = "true" / >
    < name of the parameter = "forcerewrite" value = "true" / >
    < parameter name = "outputfile" value="E:\SOAworkspace\otnapp\deploy\otntest.ear"/ >
    "< property name ="wl_server"location="D:\weblogicSA2011\wlserver_10.3\samples\domains\wl_server "/ >

    < / deploy >
    < / ojdeploy-construction >

    This blog gives you a start http://blogs.oracle.com/smuenchadf/2009/11/online_help_for_ojdeploy_utili.html
    But I can say that ojdeploy creates just the EAR file. It does not deploy it to a WLS. For this, you can use WSLT.

    Timo

  • How to connect using a webcam

    How can I connect with others using the webcam? I have a TouchSmart 320 Desk top and the operating system is Windows 7.

    TIA

    Hello

    I don't know exactly what you mean "connect". But you can use the webcam to communicate with friends, parents... There are many products autour, Skype is a very popular product. I think it is preinstalled on your computer or that you can download from the following link:

    http://www.Skype.com/en/download-Skype/Skype-for-computer/

    Kind regards.

  • How to connect using Windows 7 Wi - Fi Hotspots?

    Original title: hotspot

    How to use my labtop (windows 7) as a hopspot, I tried with a program called connectify I connect to my computer, but there is no internet connection! can someone me please, thanks

    See if this helps:-

    http://www.ComputerActive.co.UK/CA/step-by-step/2125739/laptop-mini-WiFi-hotspot

  • How can I use my admin account when I forgot my computer password?

    I was recently reading to make a password reset disk. I did it successfully. I also redesigned and strengthened my index of password to make it just something I'll remember.

    I also read that I could also connect to my laptop using my administrator account, if I forgot my password for the regular user. I don't know how to do this. The Vista Welcome screen shows my normal username when I start my computer. How to access my administrator account?

    It comes to my laptop. I'm the only one using it.

    A couple of years, I've had problems with one of the Service Packs. I had a very good help from Microsoft. One of the people helping me explained how to connect using the Admin account to display system information. I think she used the DOS prompt to change a setting. Then the Welcome screen showed the Admin account. But, if I can't log on my computer to do this, I can't do the account Admin appear on the Welcome screen. Is there another way to display the administrator account on the home screen?

    Ken

    Please re-read my first answer about your options.

    Microsoft prohibits any help given in these Forums for you help bypass or "crack" passwords lost or forgotten.

    Here's information from Microsoft, explaining that the policy:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-security/keeping-passwords-secure-Microsoft-policy-on/39f56ef0-5d68-41AD-9daa-6e6019c25d37

  • How to debug a web application remotely using Weblogic Workshop 10.3?

    I am trying to debug and application using Weblogic Workshop for Weblogic 10.3 on a remote server. I added the arguments of debugging on the server in the administration console and restarted the server, but I am unable to see debugging information in the IDE of the workshop. I am probably doing wrong... How can I reach the remote debugger?



    Thank you!

    The argument - Xdebug you provided for the execution of the server must use 'socket', and it specifies a port number. When you create the Debug configuration of the dialog ("Remote Java Application') debugging, you must also specify 'socket', the remote host name and port number. Then you connect with it.

  • How delete/fix Trojan Downloader: Java/Open Connection.LZ

    How delete/fix Trojan Downloader: Java/Open Connection.LZ?

    Hello

    Read about the MS information

    http://www.Microsoft.com/security/portal/threat/encyclopedia/entry.aspx?name=TrojanDownloader%3AJava%2FOpenConnection.LZ

    Download update and scan with the free version of malwarebytes anti-malware

    http://www.Malwarebytes.org/MBAM.php

    You can also download and run rkill to stop the process of problem before you download and scan with malwarebytes

    http://www.bleepingcomputer.com/download/anti-virus/rkill

    If it does not remove the problem and or work correctly in normal mode do work above in safe mode with networking

    Windows Vista

    Using the F8 method:

    1. Restart your computer.
    2. When the computer starts, you will see your computer hardware are listed. When you see this information begins to tap theF8 key repeatedly until you are presented with theBoot Options Advanced Windows Vista.
    3. Select the Safe Mode with networking with the arrow keys.
    4. Then press enter on your keyboard to start mode without failure of Vista.
    5. To start Windows, you'll be a typical logon screen. Connect to your computer and Vista goes into safe mode.
    6. Do whatever tasks you need and when you are done, reboot to return to normal mode.
  • My native BB app, how to connect to the remote URL and call a Web service method to retrieve the XML base result using Eclipse Version 3.7.2

    Hello

    I am new to the development of native applications from BB using JDE. I'm testing Simulator. From my native BB app, I connect a remote URL and call a Web service method to extract some basic result XML.

    I need to write a login code remote URL to achieve? If so, how?

    So, how can I use this connection object to call the Web service from this URL remotely.

    Please help me out of it...

    Many thanks in advance...

    What i am doing is, On clicking the "Login" button i want to call the webservice method like below mentioned code...
    Here WaveServices is a class and getAllCinemas() is a static method inside which a webservice method call is made..
    
    loginButtonField.setChangeListener(new FieldChangeListener() {
                public void fieldChanged(Field paramField, int paramInt) {
                    WaveServices.getAllCinemas();
                }
            });
    

    Indeed, the question was raised and answered here:

    http://supportforums.BlackBerry.com/T5/Java-development/from-my-native-BB-application-how-to-connect...

  • How RMI is used to connect to a Hyperion planning?

    Hello

    We want to document how RMI connects to Hyperion planning under the hood for our security team. Can you please help us understand this process or point us to a document?

    Thank you

    Andy

    It is basically using the Protocol Java RMI that is running on a port by default 11333, if you do a search on the internet you can find more information on Java RMI, it is only really used now (11.1.2.3) by ODI to contact the planning

    See you soon

    John

    http://John-Goodwin.blogspot.com/

  • How can I determine in Java running local or weblogic server deployment

    Using JDeveloper 11.1.1.4.0

    I need to determine in my Java code, if I run my application locally (JDeveloper/Weblogic) or if the application runs on a Weblogic Server deployed. The code will be used to determine where to place the files in the test on PC the verses where to place the files when they are deployed. For example (c:\temp or/usr2/download).

    Thank you
    Troy

    Hello

    well one way is to identify using weblogic here system properties is the example to get the name of application weblogic managed server that runs in java http://www.baigzeeshan.com/2011/11/oracle-adf-how-to-get-managed-server.html

    check out other properties like http://docs.oracle.com/cd/E13222_01/wls/docs90/config_scripting/config_WLS.html#1019588 well

    Zitouni

  • How to connect weblogic 9.2 with LDAP Port 636 (SSL Enabled)

    Hello

    We are currently connecting the weblogic administration console to LDAP using the port 989. Can someone tell us the details on how to connect Weblogic to Port 636 (SSL enabled).
    Requires you to install certificates of security for the same thing?

    Thank you

    Yes, the certificate will be provided by the LDAP Service provider.

    Check the SSL Configuration of the Weblogic Server.

    If using demo identity and demo trust, import the following

    keytool - v-import - alias ldapcert - keystore DemoTrust.jks - cert.cer - storepass DemoTrustKeyStorePassPhrase of the file

    If its custom identity and trust personalized, use the command below

    keytool - v-import - alias ldapcert - keystore cert.cer .jks-file - storepass

    Hope this helps,
    Faisal

  • How to connect to itunes for ipad airplay without using computer?

    HOW to CONNECT IPAD AIRPLAY to ITUNES WITHOUT the HELP of a FULL ❓l

    There is no need to shout. What you're trying to use AirPlay to stream content from your iPad to?

    Using AirPlay: How to use AirPlay on your iPhone, iPad or iPod touch - Apple Support.

    (I asked for your message to be moved to use iPad forum, where you have posted is for questions about the iTunes U app.)

  • How to download using mobile data instead of a Wi - Fi connection

    Dear Sir.

    I use iPhone 6s. I would like to ask for your help as to how I could use mobile data to download for the software updates. There was always a prompt message to inform that I could download when connected to a Wi - Fi network.

    Hoping to hear from you soon.

    Thank you.

    Sorry, you can not. WiFi or iTunes.

  • How can I use my Apple TV directly on portable iMac Pro? I mean directly from my iMac WITHOUT connecting to TV

    How can I use my Apple TV directly on MY iMac laptop Pro? I want to say on my iMac directly WITHOUT connecting to TV

    There is no such thing as an 'iMac Pro laptop. And you can not directly connect an ATV to something other than a HDMI entry screen.

  • How to connect another computer directly using power cord ethrenet

    How to connect another computer using power cord ethrenet, both under windows 7

    Hello

    I suggest you to refer to this link and check if it helps:

    http://Windows.Microsoft.com/en-us/Windows7/help/home-sweet-HomeGroup-networking-the-easy-way

    It will be useful.

Maybe you are looking for

  • Coursera site does not

    Firefox (version 34.0) constantly displays "Loading"... "and an 8 horizontal when I try to access www.coursera.org. It worked very well - the problem must have started in the last 6 weeks or more. I already tried in 'safe mode' and the problem persis

  • Photographs &gt; faces synchronize multiple Macs

    To do a little research, I now know what came out faces Photos was not capable of syncing between multiple Macs.  I was wondering if there is a way to do sync now or if Apple intends to work on it? I spent tons of time with faces in iPhoto, then lost

  • PLEASE GIVE ME AN EXAMPLE OF A "USER NAME".

    I do not understand why I tried to register the username has not accepted. Please give me an example of a "user name". This has happened Each time Firefox opened

  • Error code 646 security update for microsoft office excel 2007 kb973593

    Hi, I installed 4 updates and an update has not been installed. Error code is 646. Update for microsoft office excel 2007 Ko 973593 security. I really need this update to do other things worked. Please help as I can't find another solution. Thank you

  • Cant logg in msn get a picture of form1

    When I start msn live, I get a logg in the form called form1 and is in Spanish. It does not start the program. I've done virus scans and analyzes malware but they say pc is clean. the image of form1 is displayed even when I go to your site for re dow