URL Connection &  POST - java hangs

Im trying to send Query String to third party application. Until now I used to send in form of query string (GET). Now i intend use POST Method.
Following is my piece of skeletal code
String urlString = "abc" ;
URLConnection conn;
InputStream urlInputStream = null;
String urlString1 = "age=23;salary=2000";
try {
urlString1 = "http://ggg:8080/ps" + urlString ;
URL url = new URL(urlString1);
conn = url.openConnection();
System.out.println("1");
conn.setRequestProperty("Content-length", "9056"); // If I dont set this line, Im getting HTTP 411 //Response Code. I have arbritarily set 9056
System.out.println("2");
((HttpURLConnection)conn).setRequestMethod( "POST");
System.out.println("3");
System.out.println("connected");
urlInputStream = conn.getInputStream(); ---> hanging
System.out.println("4");
Output - Im getting 1, 2 and 3. But program is hanging at when it tries to getInputStream(). Im forced to quit .
Need help on this.

Here are some elements that may help you :
If you use the POST method, don't write the arguments in the URL (this is only for the GET method).
You should just open the URL, and write the POST args with an OutputStream .
urlString1 = "http://ggg:8080/ps" ;
Then, open an OutputStream with something like that :
PrintWriter out = new PrintWriter(new InputStreamWriter(conn.getOutputstrem()) ;
and write the args :
out.println("arg1=10&arg2=30") ;

Similar Messages

  • Set timeout for URL connection in java1.4

    hi
    I want to set timeout for URL connection in java 1.4..
    java 5.0 provides with a setTimeout(int ) method but how should it be done in 1.4 environment
    Thanks in advance
    sneha

    sun.net.client.defaultConnectTimeout (default: -1)
    sun.net.client.defaultReadTimeout (default: -1)
    See the [Networking Properties|http://java.sun.com/j2se/1.4.2/docs/guide/net/properties.html].

  • Close URL Connection netstat

    hello all,
    I hope you can help me.
    Please have a look at my code below
    I open an URL Connection but I can't close it.
    If i type in a DOS Box netstat I see a lot of connection.
    Now my question is how can I close the connection.
    m_http.disconnect() seems not to work.
    public class Unbenannt1 extends Applet
      Button button1 = new Button();
      private HttpURLConnection m_http = null;
      private URL m_MyAlarmURL = null;
      private URLConnection m_MyURLConnection = null;
      private long m_TimeAlarmXML = 0;
      private boolean m_TimeUpdate = true;
      /**Das Applet initialisieren*/
      public void init()
        String a_str = "http://"+ getCodeBase().getHost() + "/x.xml";
        try
          m_MyAlarmURL = new URL( a_str );
        catch ( MalformedURLException ie )
        try
          jbInit();
        catch(Exception e)
          e.printStackTrace();
      /**Initialisierung der Komponenten*/
      private void jbInit() throws Exception
        button1.setLabel("button1");
        button1.setBounds(new Rectangle(27, 28, 78, 27));
        button1.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            button1_actionPerformed(e);
        setLayout(null);
        setBackground(java.awt.Color.lightGray);
        setSize(426,266);
        this.add(button1, null);
      void button1_actionPerformed(ActionEvent e)
        int a_int = 0;
        try
            m_MyURLConnection = m_MyAlarmURL.openConnection();
            m_http = (HttpURLConnection)m_MyURLConnection;
            m_http.setRequestMethod( "HEAD" );
            m_http.setUseCaches(false);
            m_http.connect();
            a_int = m_http.getResponseCode();
            m_http.disconnect();
            m_http = null;
            m_MyURLConnection = null;
            System.gc();
          catch ( java.io.IOException ioe  )
            a_int = 404;
    }Thanks a lot
    Prediger

    Usually those connections linger around for some time, and will then be closed by the OS once a certain timeout has been reached. I don't know how to change that timeout, though.
    Btw: the docs don't claim that the connection will be closed. The description for disconnect() is "Indicates that other requests to the server are unlikely in the near future"
    If you still see the connection after a while, then something is wrong, but I've seen connections like that hang around for several minutes even after the JVM was terminated.
    Thomas

  • Java hangs

    Hi all,
    I am facing an issue in java.
    Problem,
    The sever stop responding to anything, it just hangs, cannot be restarted unless killing java process through task manager. does not respond to hprof, jstacktrace, jvisio, console, anything.
    the problem occurs very intermittently, some time it works, some time it doesn't, so, very difficult keep track of this.
    when tried to debugging, it seems to be hanging on creating a instance using constructor.newInstance() method.
    Especially in sun.rmi.server.Util.createStub() method.
    which is trying to create a stub object, it prints (sys.out.println) the loaded stub class and constructor also, but newInstance method hangs and do not print then onwards.
    // sun.rmi.server.remote.Util.java
    private static RemoteStub createStub(Class remoteClass, RemoteRef ref)
    throws StubNotFoundException
    String stubname = remoteClass.getName() + "_Stub";
    try {
    Class stubcl =
    Class.forName(stubname, false, remoteClass.getClassLoader());
    Constructor cons = stubcl.getConstructor(stubConsParamTypes);
    return (RemoteStub) cons.newInstance(new Object[] { ref });
    } catch {
    it hangs here,, (RemoteStub) cons.newInstance(new Object[] { ref });
    it is very intermittent, once for so many attempts,
    Please help about the ways this can be debugged further or any solution to this.
    Thanks,
    Kalpa

    If only it was as simple as making a post in a forum and then sitting back and waiting for answers.
    But it is not. It will take plenty of smart people investigating every tiny little corner of the working environment to see where the problem may stem from. It starts by changing your attitude - it is too soon to claim that "java hangs". It might just as well be the OS that is blocking the process for some reason. You seem to have traced this to RMI, which opens network connections. Perhaps that is failing.
    Check every log file available in the system, that is all I can say. If you must blame Java, try running with an alternate version (older and newer) to see if that changes anything. Create proof before you make claims.

  • Url connection refused to site

    Hi,
    I was using a program to connect to a website to pull down data and store in a file. Now I'm getting the following error:
    java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at sun.net.NetworkClient.doConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.<init>(Unknown Source)
         at sun.net.www.http.HttpClient.<init>(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at pcxtrade.URLAccess.<init>(URLAccess.java:23)
         at pcxtrade.URLAccess.main(URLAccess.java:50)
    After working for a while I'm getting blocked. How can I go around it? Thank you very much

    It would appear that either a) you have the wrong IP address and/or port of b) the server is explicitly disallowing your connection.
    1) Find out the IP address and port.
    2) Put a logging statement in right before your call to the API's connect method that spells out what URL you're connecting to.
    3) Look again at the error message and see if it provides any more detail about the server/port than what you've provided here.
    If the above tell you that you've got the wrong address/port, then put the right one in. If they tell you that you've got the right one, then see if you can connect via telnet or web browser. If the other connection method also fails, then you need to talk to the owner of the site, or your company's firewall admins or somebody. If the other methods let you get through, then it's your code, and you'll have to post the code here to get help debugging it.

  • Change url connection to socket

    hello i have a problem about a socket connection can you help me
    i want to change url connection to socket connection
    here is
              java.net.URL url = new java.net.URL("http://64.74.75.74/approot/webapp/ZOR/bare");
              connection = new sun.net.www.protocol.http.HttpURLConnection(url, " ", 0);
              connection.setRequestMethod("POST");
              connection.setDoInput(true);
              connection.setDoOutput(true);
              connection.setUseCaches(false);
              java.io.ObjectOutputStream out = new java.io.ObjectOutputStream(connection.getOutputStream());
              out.writeObject(getTextFieldGiden().getText());
              out.flush();
              out.close();
              return (String) (new java.io.ObjectInputStream(connection.getInputStream()).readObject());how can i change it to
    socket connection because i must write it in c++
    thank you very much

    why are you replaying if you don' t have a solution peter?
    i have a big c++ project and in it somewhere must do the job the code i send in java do.
    &#304; also want to say i dont want it's c++ code ,i want to know how it can be with java sockets.

  • Crystal Reports data connection using Java beans

    Hi
    My name is Bach Ong, i'm currently perform re-configuring Crystal reports 2008 to connect via
    Java bean to Jboss server, this uses look up service on JBoss server. The connection is using Connect
    look up using the properties:
    java.naming.provider.url=jnp://emgsydapp121:10499
    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
    for file CRConfig.xml i put as follows:
    <JDBCURL></JDBCURL>
    <JDBCClassName></JDBCClassName>
    <JDBCUserName></JDBCUserName>
    <JNDIURL>jnp://emgsydapp121:10499</JNDIURL>
    <JNDIConnectionFactory>org.jnp.interfaces.NamingContextFactor
    y</JNDIConnectionFactory>
    <JNDIInitContext>/</JNDIInitContext>
    <JNDIUserName></JNDIUserName>
    Can you advise us if this step is correct, and is there any
    documentation that can guide us to right direction.
    for Java testing in Eclipse using remote call class it is working suing the following code:
            Properties p = new Properties();
            p.put(Context.INITIAL_CONTEXT_FACTORY,
            "org.jnp.interfaces.NamingContextFactory");
            p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
            p.put(Context.PROVIDER_URL, "jnp://emgsydapp121:10499");
             InitialContext ctx = new InitialContext(p);
      Date asAtDate = CrystalUtils.convertToDate("2014-01-01", CrystalUtils.relativeToToday(0), false);
         String asxCode = "BHP";
         ClosingPricesReportRequest criteria = new ClosingPricesReportRequest(asAtDate, asxCode);
         InitialContext context = new InitialContext(p);
         ClosingPricesReportService ejb = (ClosingPricesReportService) context.lookup(ClosingPricesReportService.REMOTE_JNDI);
         ClosingPricesReport report = ejb.createMTMClosingPriceReport(criteria);
         System.out.println(report.getClosingPrices()[0].getClosingPrice());
         testval = report.getClosingPrices()[0].getClosingPrice().toString();
         System.out.println(testval);
    when i run the tes code the results as follow:
    10:49:45,244 DEBUG [SecurityAssociation ] Using ThreadLocal: false
    10:49:45,338 DEBUG [MicroSocketClientInvoker ] SocketClientInvoker[709446e4, socket://emgsydapp121:10473] constructed
    10:49:45,338 DEBUG [MicroRemoteClientInvoker ] SocketClientInvoker[709446e4, socket://emgsydapp121:10473] connecting
    10:49:45,338 DEBUG [MicroSocketClientInvoker ] Creating semaphore with size 50
    10:49:45,338 DEBUG [MicroRemoteClientInvoker ] SocketClientInvoker[709446e4, socket://emgsydapp121:10473] connected
    10:49:45,369 DEBUG [ClientSocketWrapper ] reset timeout: 0
    10:49:45,650 DEBUG [InvokerRegistry ] removed SocketClientInvoker[709446e4, socket://emgsydapp121:10473] from registry
    10:49:45,650 DEBUG [MicroSocketClientInvoker ] SocketClientInvoker[709446e4, socket://emgsydapp121:10473] disconnecting ...
    10:49:45,650 DEBUG [SocketWrapper ] ClientSocketWrapper[Socket[addr=/10.137.2.40,port=10473,localport=64150].2cba5bdb] closing
    37.99000000000000198951966012828052043914794921875
    37.99000000000000198951966012828052043914794921875
    Can anyone assist me in convert the above settings to get access by Crystal reports.
    My attemp current are below:
    public class CFDClosingPricesRpt extends CrystalReport {    
        //Constructor
        public CFDClosingPricesRpt(){
            super(ClosingPriceBean.INSTANCE);
         * Returns the ResultSet for this report to Crystal.
         * @param asxCode
         * @param asAtDateString
         * @return
    public ResultSet getNewReport(String asxCode, String asAtDateString) {                     
         try {
             Properties p = new Properties();
             p.put(Context.INITIAL_CONTEXT_FACTORY,
             "org.jnp.interfaces.NamingContextFactory");
             p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
             p.put(Context.PROVIDER_URL, "jnp://emgsydapp121:10499");
             //InitialContext ctx = new InitialContext(p);
             clearCachedReportBeans();     
       Date asAtDate = CrystalUtils.convertToDate("2013-01-01", CrystalUtils.relativeToToday(0), false);
          asxCode = "BHP";
          ClosingPricesReportRequest criteria = new ClosingPricesReportRequest(asAtDate, asxCode);
          //ClosingPricesReportService ejb = (ClosingPricesReportService) ctx.lookup(ClosingPricesReportService.REMOTE_JNDI);
          ClosingPricesReportService ejb = (ClosingPricesReportService) ServiceLocator.getInstance().getService(ClosingPricesReportService.REMOTE_JNDI);           
          ClosingPricesReport report = ejb.createClosingPriceReport(criteria);
          // assemble Crystal-friendly DTO
          Collection closingPrices = Arrays.asList(report.getClosingPrices());
          for (Iterator iter = closingPrices.iterator(); iter.hasNext();) {
                    MBLXClosingPrice cp = (MBLXClosingPrice) iter.next();               
                    if (cp==null) continue;               
                    addReportBean(new ClosingPriceBean( report.getSuppliedDate(),
                                cp.getClosingPrice(),
                                cp.getAsxCode()));
      } catch (Throwable x) {     
          saveErrorMessage(x);
      return getAsResultSet();             
    Thanks
    Bach Ong

    Hi Don Thanks for the reply.
    I've was able to connect via Java beans and JNDI. But this one is going the JNDI of JBoss sever, which the JNDI already configure and working for Crystal reports v10.
    Bach

  • Map Viewer URL Connection Issue

    Hi,
    I have an UI project, for which i have created a Deployment Profile named 'adfXXXXXUI' nothing but created a adflibrary for that UI project.
    While creating the adf jar, i have come across an Option called 'Connections' .
    Here i have selected Connection Names Only ... means i will be getting all the names of the connections i have created & those will be reflected in my local connection.xml file.
    After configuring the rest of the params, i deployed my UI project to "deploy -> adfXXXXXUI.jar".
    And we have used this jar to integrate with another UI application ... And the taskflows avilable in the jar will be used in the other UI application.
    Now here is my problem ... Actually my connections.xml file has a URL Connection. This is how it looks like....
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <References xmlns="http://xmlns.oracle.com/adf/jndi">
    <Reference name="MapServer" className="oracle.adf.model.connection.url.HttpURLConnection" xmlns="">
    <Factory className="oracle.adf.model.connection.url.URLConnectionFactory"/>
    <RefAddresses>
    <XmlRefAddr addrType="MapServer">
    <Contents>
    <urlconnection name="MapServer" url="http://sbsys1.intra.schneider.com:8109/mapviewer"/>
    </Contents>
    </XmlRefAddr>
    </RefAddresses>
    </Reference><Reference name="snibuilddb" className="oracle.jdeveloper.db.adapter.DatabaseProvider" credentialStoreKey="snibuilddb" xmlns="">
    <Factory className="oracle.jdeveloper.db.adapter.DatabaseProviderFactory"/>
    <RefAddresses>
    <StringRefAddr addrType="subtype">
    <Contents>oraJDBC</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="user">
    <Contents>sni_guest</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="port">
    <Contents>3720</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="hostname">
    <Contents>uxsys186v</Contents>
    </StringRefAddr>
    <SecureRefAddr addrType="password"/>
    <StringRefAddr addrType="serviceName">
    <Contents>snit0.world</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="DeployPassword">
    <Contents>true</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="oraDriverType">
    <Contents>thin</Contents>
    </StringRefAddr>
    </RefAddresses>
    </Reference>
    </References>
    All the taskflows avaialble in my jar using the URL connection which mentioned above. But the adflibray jar got created with a file named 'jar-connection.xml', where i can see <Reference/> as an empty Tag. Because i have selected connections name only as an option when creating the adflibrary for my UI.
    Hence it is appearing so ... But when i added this jar to the other application, i have dragged & dropped the taskflows as a region on to the JSPX page. And i started running the page. On the page .... i can see only the data which is not making use of MapServer connection defiition. Along with that, some maps needs to rendered .. but that is not happening. Rest of the page with the filter critieria is being displayed properly.
    Now i have selected Include Connection Details as an option, by editing the adfLibrary Deployment profile of the UI & redeployed & found the same thing. Like, though i specify the Include Connection Details as an option ... i did not see those URL connection details in my jar-connection.xml file.Still it is not working.
    All the taskflows inside the jar are trying to use this URL connection from jar-connection.xml, which is avaiable inside the adfLibUI.jar.
    I tried with a scenorio some thing like ... For the application to which i have added this adfUILibrary, there itself i created a URLConnection ... but it did not worked as well.
    Requesting you to let me know how can i get avail of my URL connection in to my jar ...
    Thanks & Regards,
    Kiran Konjeti

    This is purely ssl issue. You can try adding the below logic first.. This code basically sets ssl properties for us.
    import java.security.Security;
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    Properties properties = System.getProperties();
    String handlers = System.getProperty("java.protocol.handler.pkgs");
    if (handlers == null) {
        // nothing specified yet (expected case)
        properties.put("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
    else {
        // something already there, put ourselves out front
        properties.put("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol|".concat(handlers));     
    System.setProperties(properties);
    Below you start your code....

  • How to make pool of  url connections in wls?

    Hi, i have a project in which i have to make a http post to multiple web
              servers to retrieve
              XML files in response to user requests. Right now i just open the
              url for each request.
              Is there any way to pool URL connections in weblogic
              thanks
              wasiq
              

    Are u using Custom Connection Pool or some App Servers Conn Pool for LDAP Connection?
    If you are opening LDAP Connection in your program code and wondering how to monitor, then it needs to be done on the LDAP Server side. Not from the application.

  • Encrypting authentication details - HTTP URL Connection

    Hi,
    We have a Java application which retreives HTML content from intranet page using HTTPURLConnection, displays the portion of the content. The site to which we are connecting using HTTPURLConnection requires baisc user authentication and we are passing the user name and passowrd using BASE 64 encoding in the request header. Now this intranet site is going to be hosted externally. Just wanted to know the different options on how to send the user name and password in ecnrypted format.Is the recommendation is just to enable HTTPS for that site and pass user name and password using HTTP URL Connection API? Or are there any other options? Appreciate any inputs.
    Thanks.

    http://java.sun.com/javase/6/docs/technotes/guides/net/http-auth.html

  • HttpsURLConnection URL connection issue

    Hi All,
    I need to create URL connection with HTTPS URL. I can run Main java class successfully in machine which hosted in SAP Java server, but fail to run integrate it with e-commence application. When depployed in to SAP Java server cannot open HttpsURLConnection and always return CalssCastexception. However same code run as Java Main class
    Is this can be a (SSL) Handshake? or is this SSL issue?
    MyCode:
    String httpsURL = "https://encrypted.google.com/";
        URL myurl = new URL(httpsURL);
        HttpsURLConnection con = (HttpsURLConnection)myurl.openConnection();
        InputStream ins = con.getInputStream();
        InputStreamReader isr = new InputStreamReader(ins);
        BufferedReader in = new BufferedReader(isr);
        String inputLine;
        while ((inputLine = in.readLine()) != null) {
          System.out.println(inputLine);
        in.close();
    Thank You

    This is purely ssl issue. You can try adding the below logic first.. This code basically sets ssl properties for us.
    import java.security.Security;
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    Properties properties = System.getProperties();
    String handlers = System.getProperty("java.protocol.handler.pkgs");
    if (handlers == null) {
        // nothing specified yet (expected case)
        properties.put("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
    else {
        // something already there, put ourselves out front
        properties.put("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol|".concat(handlers));     
    System.setProperties(properties);
    Below you start your code....

  • Connect to java data srvice

    hi,
    how to connect to java data/services ?
    I  had this error :
    Invalid root. The WEB-INF/flex folder must contain either flex-config.xml or services-config.xml.
    my project java is in : D:\SVN\VAZII\trunk\VaziiAdminService
    my project flex tha must use the service is in : D:\SVN\ICOSNET_WALLET\trunk\ConfortPayAdmin
    My server tomcat is in : C:\apache-tomcat-7.0.32
    what i must write in this input dialog box ?
    Root Folder, Root URl, and Context root
    thanks

    is there someone that knows flash builder here ?

  • Bug fix for "Java Hangs When Converting 2.2250738585072012e-308" for SAPJVM

    Hi All,
    There is a new java runtime security alert found (see URL below) :
    Java Hangs When Converting 2.2250738585072012e-308
    http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/
    I'm wondering if any of you noticed this bug ? Does SAP JVM (various versions) also exsibit this
    bug too ?
    Thanks,
    Ying-Jie Chen

    Just to add:
    Note 1556366 - Java Runtime hangs when converting a certain number
    Markus

  • How set up URL Connection Factory/Resource?

    Hi,
    How to set up URL connection Factory, Exactly like JDBC connection Pool i.e. specifying
    Max. No. of Connection, Intial capacity etc.
    I'm able to find this much only.
    <WebServer URLResource="weblogic.httpd.url.myURL=http://localhost:7701/blah"
    />
    But If i want to set Max. Capacity/ Intial capacity for URL Connection Factory,
    Where to specify it?
    Will you please help me?
    Regards,
    Devendra

    Hi,
    The Simplest Way to Load a Property file (Which is outside of your Application) ..is.
    Just Place the Property file in the Server Classpath...or in the "C:\bea103\user_projects\domains\7001_Domain\lib" folder of your Domain. It means somehow the Property file should be available in the Server Classpath...
    Now Please write the following code in your Application to read the Property file:
    java.util.Properties prop = new java.util.Properties();
    java.io.InputStream stream=this.getClass().getClassLoader().getResourceAsStream(“my.properties”);
    prop.load(stream);
    String hostProperty = p.getProperty(“host.name”);
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com/generalweblogic/   (WebLogic Wonders Are Here)

  • Calling a URL from a Java Stored Procedure

    Hi,
    I'm trying to call a URL from a Java Stored Procedure in Oracle 8.1.7(Windows 2000). The ultimate goal is to call this stored procedure from a database trigger. The status of the object remains invalid in the database even after compilation and publishing without any errors. The code follows. Any suggestions/alternatives to accomplish this would be appreciated.
    Java Stored Procedure:
    CREATE OR REPLACE JAVA SOURCE NAMED "UPDATEATTR" AS
    import java.net.*;
    import java.util.*;
    import java.io.*;
    public class UpdateAttr {
    public static String testmain() {
    ObjectInputStream is;
    URL url;
    String uri =
    "http://www.yahoo.com";
    try {
    //calling the URL
    url = new URL(uri);
    URLConnection yahooConnection = yahoo.openConnection();
    } catch (Exception e) {
         e.printStackTrace(System.err);
    return "TEST_SUCCESSFUL";
    Code to Publish it:
    CREATE OR REPLACE FUNCTION setNewAttributes return VARCHAR2
    AS LANGUAGE JAVA NAME
    'UpdateAttr.testmain() return String';
    Thanks in advance.
    Ris

    Small mistake in the previous post. The object still has a status of "INVALID" though. The Java stored procedure should actually read:
    Java Stored Procedure:
    CREATE OR REPLACE JAVA SOURCE NAMED "UPDATEATTR" AS
    import java.net.*;
    import java.util.*;
    import java.io.*;
    public class UpdateAttr {
    public static String testmain() {
    ObjectInputStream is;
    URL url;
    String uri =
    "http://www.yahoo.com";
    try {
    //calling the URL
    URL yahoo = new URL(uri);
    URLConnection yahooConnection = yahoo.openConnection();
    } catch (Exception e) {
    e.printStackTrace(System.err);
    return "TEST_SUCCESSFUL";
    Code to Publish it:
    CREATE OR REPLACE FUNCTION setNewAttributes return
    VARCHAR2
    AS LANGUAGE JAVA NAME
    'UpdateAttr.testmain() return String';
    /

Maybe you are looking for

  • Yoga 2 Pro Install Windows 8 on a Android 4.4 Version

    Hello Community! Ich got a Yoga 2 Pro with Android 4.4. It was a Chrismas present. For my work I prefer a Windows Version for all the application. It is possible to install myself a Windows 8 RT Version on the tablet? I saw a few US- Version of the Y

  • Pricing update

    Hi! I have a problem with pricing update. For example I change information in pricing procedure adding new condition type but this new condition type appears in orders only in several hours. CRM version 5.0. Tell me please what can I do to speed up t

  • Best practices for sharing a SAN-attached tape loader between servers.

    When configuring zones to allow a tape loader to be shared by multiple servers, is there a preferred zoning method? For instance, I have my primary fabric configured so that the zone for each data server using a LUN on my array consists of the primar

  • Possible to send PO item info with PO cancellation?

    Hello! We are running "pseudo" standalone SRM 5.0. The "pseudo" is because we are using a legacy backend, emulating R/3. We need to send PO cancellation back to our legacy using XI/PI. The standard PROXY for this, "PurchaseOrderCancellationRequest_Ou

  • _x values

    Why are the values for x and y different on the Properties toolbar vs. getProperty(object, _x)? I'm using AS to get the position of a tweened movie clip, and when I compare the values at the start and end of the tween with the values from the Propert