What's wrong with my simple IO code?

import java.io.*;
public class test4
public static void main(String arg[])throws IOException
File f=new File("u:/temp.txt");
f.createNewFile();
FileWriter fwriter=new FileWriter(f,true);     
fwriter.write("can you see me?");
}

You have to close your, and you really should flush,
your fwriter before sending any data to file:You mean after sending any data, right? ;)
fwriter.flush();
fwriter.close();I suppose it doesn't hurt to be explicit, but the flush() isn't strictly necessary as close() flushes the stream before closing it (as per the API docs). I'll leave it to you as to what level of verbosity you want.

Similar Messages

  • What is wrong with this simple JSP code?

    Whenever I run it on a browser it goes the SQL exception, but when I run it in a Java compiler it works fine.
    Any help very much appreciated
    <head>
    <%@ page
         import = "java.io.*"
         import = "java.lang.*"
         import = "java.sql.*"
    %>
    <title>
    JSP Example 2
    </title>
    </head>
    <body>
    <h1>JSP Example 2</h1>
    <%
    try
    // Load the driver class
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         try
         // Define the data source for the driver
              String sourceURL = "jdbc:odbc:my_library";
         // Create a connection through the DriverManager
              Connection databaseConnection = DriverManager.getConnection(sourceURL,"","");
              out.println("Here");
         Statement statement = databaseConnection.createStatement();
         ResultSet authorNames = statement.executeQuery("Select * from tblAvailable_Items");
         catch (SQLException s)
              out.println("SQL Error<br>");
         catch (ClassNotFoundException err)
              out.println("Class loading error");
    %>
    </body>
    </html>

    Hi...
    I have made some modifications to your code.. Try this. I assume, you would configured the system dsn as my_library, a table name "Table1" with one of the fields name as "name"
    <head>
    <%@ page import = "java.io.*,java.lang.*,java.sql.*" %>
    <title>
    JSP Example 2
    </title>
    </head>
    <body>
    <h1>JSP Example 2</h1>
    <%
    try
    // Load the driver class
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    try
    // Define the data source for the driver
    String sourceURL = "jdbc:odbc:my_library";
    // Create a connection through the DriverManager
    Connection databaseConnection = DriverManager.getConnection(sourceURL,"","");
    out.println("Here");
    Statement statement = databaseConnection.createStatement();
    String sql = "select * from Table1";
    ResultSet authorNames = statement.executeQuery(sql);
    while (authorNames.next()){
                             String Name = authorNames.getString("name");
    out.println(Name);
    catch (SQLException s)
    out.println("SQL Error<br>");
    catch (ClassNotFoundException err)
    out.println("Class loading error");
    %>
    </body>
    </html>
    Regds
    Vasi

  • What's wrong with this simple code?

    What's wrong with this simple code? Complier points out that
    1. a '{' is expected at line6;
    2. Statement expected at the line which PI is declared;
    3. Type expected at "System.out.println("Demostrating PI");"
    However, I can't figure out them. Please help. Thanks.
    Here is the code:
    import java.util.*;
    public class DebugTwo3
    // This class demonstrates some math methods
    public static void main(String args[])
              public static final double PI = 3.14159;
              double radius = 2.00;
              double area;
              double roundArea;
              System.out.println("Demonstrating PI");
              area = PI * radius * radius;
              System.out.println("area is " + area);
              roundArea = Math.round(area);
              System.out.println("Rounded area is " + roundArea);

    Change your code to this:
    import java.util.*;
    public class DebugTwo3
         public static final double PI = 3.14159;
         public static void main(String args[])
              double radius = 2.00;
              double area;
              double roundArea;
              System.out.println("Demonstrating PI");
              area = PI * radius * radius;
              System.out.println("area is " + area);
              roundArea = Math.round(area);
              System.out.println("Rounded area is " + roundArea);
    Klint

  • What's wrong with a simple login.jspx?

    Hello,
    I wrote a simple login.jspx page by following the indications at http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/adding_security.htm#BABDEICH
    Now, the page works with Firefox 5, but does not with IE 7. When under IE 7, the page keeps reloading giving errors about *"AdfBootStrap undefined*" or *"AdfLogger undefined".*
    What is wrong? Please note that I have already read all the threads on the forum about this issue, without actually solving my problem (I have not really seen any useful solutions there to be honest).
    Jdeveloper is 11.1.1.5.0, only adf authentication is enabled.
    The error messages are like the following ones:
    http://forums.oracle.com/forums/thread.jspa?threadID=952977&tstart=29
    thanks.
    Edited by: user10047839 on 27-giu-2011 8.07
    Changing from jspx to jsp does not solve the problem.

    Hello codeplay,
    in the source code of the page I have the following similar to your line:
    <script type="text/javascript" src="/Myapp/afr/partition/ie/default/opt/boot-11.1.1.5.0-1095.js"></script>
    No lines with SHERMAN inside.
    I could not open "/Myapp/afr/partition/ie/default/opt/boot-11.1.1.5.0-1095.js" or
    "afr/partition/ie/default/opt/boot-11.1.1.5.0-1095.js". Page not found
    Why does it happen with login page only?
    In firefox, as opposite to ie, where the page is rendered a little better (not as good as it should be though, due to these problems), I can login and be redirected to the secured main page, which is another .jsp, more complex than the simple login page, and there I have no problems at all.
    I noticed that the badly rendered page has a link pointing to the generated html below. NOTE that JavaScript IS ENABLED in my IE despite what this html says at the end. I checked this twice:
    WHAT IS WRONG??????????
    <html lang="en-EN"><head><script>
    ** Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
    * This is the loopback script to process the url before the real page loads. It introduces
    * a separate round trip. During this first roundtrip, we currently do two things:
    * - check the url hash portion, this is for the PPR Navigation.
    * - do the new window detection
    * the above two are both controled by parameters in web.xml
    * Since it's very lightweight, so the network latency is the only impact.
    * here are the list of will-pass-in parameters (these will replace the param in this whole
    * pattern:
    * viewIdLength view Id length (characters),
    * loopbackIdParam loopback Id param name,
    * loopbackId loopback Id,
    * loopbackIdParamMatchExpr loopback Id match expression,
    * windowModeIdParam window mode param name,
    * windowModeParamMatchExpr window mode match expression,
    * clientWindowIdParam client window Id param name,
    * clientWindowIdParamMatchExpr client window Id match expression,
    * windowId window Id,
    * initPageLaunch initPageLaunch,
    * enableNewWindowDetect whether we want to enable new window detection
    * jsessionId session Id that needs to be appended to the redirect URL
    * enablePPRNav whether we want to enable PPR Navigation
    var id = null;
    var query = null;
    var href = document.location.href;
    var hashIndex = href.indexOf("#");
    var hash = null;
    /* process the hash part of the url, split the url */
    if (hashIndex > 0)
    hash = href.substring(hashIndex + 1);
    /* only analyze hash when pprNav is on (bug 8832771) */
    if (false && hash && hash.length > 0)
    hash = decodeURIComponent(hash);
    if (hash.charAt(0) == "@")
    query = hash.substring(1);
    else
    var state = hash.split("@");
    id = state[0];
    query = state[1];
    href = href.substring(0, hashIndex);
    /* process the query part */
    var queryIndex = href.indexOf("?");
    if (queryIndex > 0)
    /* only when pprNav is on, we take in the query from the hash portion */
    query = (query || (id && id.length>0))? query: href.substring(queryIndex);
    href = href.substring(0, queryIndex);
    var jsessionIndex = href.indexOf(';');
    if (jsessionIndex > 0)
    href = href.substring(0, jsessionIndex);
    /* we will replace the viewId only when pprNav is turned on (bug 8832771) */
    if (false)
    if (id != null && id.length > 0)
    href = href.substring(0, href.length - 10) + id;
    var isSet = false;
    if (query == null || query.length == 0)
    query = "?";
    else if (query.indexOf("_afrLoop=") >= 0)
    isSet = true;
    query = query.replace(/_afrLoop=[^&]*/, "_afrLoop=12570889997779");
    else
    query += "&";
    if (!isSet)
    query = query += "_afrLoop=12570889997779";
    /* below is the new window detection logic */
    var initWindowName = "_afr_init_"; // temporary window name set to a new window
    var windowName = window.name;
    // if the window name is "_afr_init_", treat it as redirect case of a new window
    if ((true) && (!windowName || windowName==initWindowName ||
    windowName!="1bvr27bkx4_1"))
    /* append the _afrWindowMode param */
    var windowMode;
    if (false)
    /* this is the initial page launch case,
    also this could be that we couldn't detect the real windowId from the server side */
    windowMode=0;
    else if ((href.indexOf("/__ADFvDlg__") > 0) || (query.indexOf("__ADFvDlg__") >= 0))
    /* this is the dialog case */
    windowMode=1;
    else
    /* this is the ctrl-N case */
    windowMode=2;
    if (query.indexOf("_afrWindowMode=") >= 0)
    query = query.replace(/_afrWindowMode=[^&]*/, "_afrWindowMode="+windowMode);
    else
    query = query += "&_afrWindowMode="+windowMode;
    /* append the _afrWindowId param */
    var clientWindowId;
    /* in case we couldn't detect the windowId from the server side */
    if (!windowName || windowName == initWindowName)
    clientWindowId = "null";
    // set window name to an initial name so we can figure out whether a page is loaded from
    // cache when doing Ctrl+N with IE
    window.name = initWindowName;
    else
    clientWindowId = windowName;
    if (query.indexOf("_afrWindowId=") >= 0)
    query = query.replace(/_afrWindowId=\w*/, "_afrWindowId="+clientWindowId);
    else
    query = query += "&_afrWindowId="+clientWindowId;
    var sess = "";
    if (sess.length > 0)
    href += sess;
    /* if pprNav is on, then the hash portion should have already been processed */
    if ((false) || (hash == null))
    document.location.replace(href + query);
    else
    document.location.replace(href + query + "#" + hash);
    </script><noscript>JavaScript is not enabled in your browser.</noscript></head></html>

  • What's wrong with my simple syntax?

    Hi, Im trying to create a var and then check it with an if
    statment but its not working, whats going wrong?
    var loggedin:String = new String();
    loggedin = ("yes");
    if (loggedin == "yes")
    searchbox1.text = ("user logged in");

    Your code worked for me:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    private var ac:ArrayCollection = new ArrayCollection();
    public function init():void
    var loggedin:String = new String();
    loggedin = ("yes");
    if (loggedin == "yes")
    searchbox1.text = ("user logged in");
    ]]>
    </mx:Script>
    <mx:TextArea id="searchbox1"/>
    </mx:Application>

  • What is wrong with this simple PL/SQL..

    Hello,
    I made a PL/SQL to recreate user (if user exits already, then drop/recreate)
    I run this script and it won't drop the existed user as expected, what is wrong..?
    run like:
    $ sqlplus system/password@dbname @create_user.sql 'A1' --A1 is a user who already existed.
    conn /as sysdba
    SET FEEDBACK OFF SERVEROUTPUT ON VERIFY OFF TERMOUT OFF
    DECLARE
    v_count INTEGER := 0;
    v_statement VARCHAR2 (200);
    BEGIN
    SELECT COUNT (1)
    INTO v_count
    FROM dba_users
    WHERE username = UPPER ('&1');
    IF v_count != 0
    THEN
    EXECUTE IMMEDIATE ('DROP USER &1 CASCADE');
    END IF;
    v_statement :=
    'CREATE USER &1 IDENTIFIED BY &1'
    || ' DEFAULT TABLESPACE USER_DATA'
    || ' TEMPORARY TABLESPACE TEMPORARY_DATA'
    || ' PROFILE DEFAULT ACCOUNT UNLOCK';
    EXECUTE IMMEDIATE (v_statement);
    -- Grant permissions
    EXECUTE IMMEDIATE ('GRANT READ_USER TO &1 WITH ADMIN OPTION');
    EXECUTE IMMEDIATE ('ALTER USER &1 DEFAULT ROLE ALL');
    EXECUTE IMMEDIATE ('GRANT CREATE PUBLIC SYNONYM TO &1');
    EXECUTE IMMEDIATE ('GRANT CREATE DATABASE LINK TO &1');
    EXECUTE IMMEDIATE ('GRANT CREATE SNAPSHOT TO &1');
    EXECUTE IMMEDIATE ('GRANT CREATE TABLE TO &1');
    EXECUTE IMMEDIATE ('GRANT DROP PUBLIC SYNONYM TO &1');
    EXECUTE IMMEDIATE ('GRANT QUERY REWRITE TO &1');
    EXECUTE IMMEDIATE ('GRANT RESTRICTED SESSION TO &1');
    EXECUTE IMMEDIATE ('GRANT SELECT ANY DICTIONARY TO &1');
    EXECUTE IMMEDIATE ('GRANT SELECT ANY TABLE TO &1');
    EXECUTE IMMEDIATE ('GRANT UNLIMITED TABLESPACE TO &1');
    EXECUTE IMMEDIATE ('GRANT SELECT ON SYS.CHANGE_TABLES TO &1');
    EXECUTE IMMEDIATE ('GRANT SELECT ON SYS.DBA_SUBSCRIBED_TABLES TO &1');
    EXECUTE IMMEDIATE ('GRANT SELECT ON SYS.DBA_SUBSCRIPTIONS TO &1');
    EXECUTE IMMEDIATE ('GRANT EXECUTE ON SYS.DBMS_CDC_PUBLISH TO &1');
    EXECUTE IMMEDIATE ('GRANT EXECUTE ON SYS.DBMS_CDC_SUBSCRIBE TO &1');
    EXECUTE IMMEDIATE ('GRANT EXECUTE ON SYS.DBMS_CDC_UTILITY TO &1');
    EXECUTE IMMEDIATE ('GRANT EXECUTE ON SYS.DBMS_LOCK TO &1');
    EXECUTE IMMEDIATE ('GRANT EXECUTE ON SYS.DBMS_SYSTEM TO &1');
    EXECUTE IMMEDIATE ('GRANT EXECUTE ON SYS.DBMS_UTILITY TO &1');
    EXECUTE IMMEDIATE ('GRANT READ, WRITE ON DIRECTORY SYS.PUBLIC_ACCESS TO &1 WITH GRANT OPTION');
    DBMS_OUTPUT.put_line (' ');
    DBMS_OUTPUT.put_line ('User &1 created successfully');
    DBMS_OUTPUT.put_line (' ');
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line (SQLERRM);
    DBMS_OUTPUT.put_line (' ');
    END;
    Exit;
    EOF
    Thank you
    Jerry

    Hi,
    I try to run this command in a shel scriptl, following this pl/sql excuting is a exp core shcema/imp to this user by using pipe.
    (--this part is working well)
    so I try to debug the pl/sql part first that is why I didn't use & or &&, which need to interactive with computer on scene, but this shell script will run automatically by scheduler.
    this is the whole shell,
    #!/bin/ksh
    INPUT_DATABASE_SCHEMA=$1
    OUTPUT_DATABASE_SCHEMA=$2
    TARGET_DATABASE=$3
    #drop/recreate user $2
    sqlplus system/$3@$3 @create_user.sql '$2' ---this is also the question? how make it as real variable $2, not literal
    #exp
    mknod ./$1_exp p
    gzip < $1_exp > ./$1_exp.dmp.gz &
    exp \
    rows=y \
    userid=system/$3@$3 \
    owner=$1 \
    log=$1_exp.log \
    file=$1_exp \
    direct=y \
    recordlength=65535 \
    statistics=none \
    consistent=y \
    compress=n \
    grep 'ORA-' $1_exp.log
    if [ $? = 0 ]
    then
    mail -s "Problem in regression snapshort export" email < $1_exp.log
    fi
    #imp
    mknod ./$1_exp p
    gunzip < $1_exp.dmp.gz > $1_exp &
    imp \
    userid=system/$3@$3 \
    file=$1_exp \
    log=$2_IMP.log \
    buffer=500000000 \
    ignore=y \
    commit=y \
    fromuser=$1 \
    touser=$2 \
    feedback=100000 \
    GRANTS=n \
    grep 'ORA-' $2_IMP.log
    if [ $? = 0 ]
    then
    mail -s "Erros found in regression snapshort import" email < $2_IMP.log
    else
    mail -s "regression snapshort is done sucessfully" email < $2_IMP.log
    fi
    #recompile invalid
    sqlplus system/$3@$3 << EOF
    conn /as sysdba
    @?/rdbms/admin/utlrp.sql
    Exit;
    EOF
    thank you in advance

  • What's wrong with this simple method

    i'm having compile troubles with this simple method, and i think it's got to be something in my syntax.
    public String setTime()
    String timeString = new String("The time is " + getHours() + ":" + getMinutes() + ":" + getSeconds() + " " + getIsAM());
    return timeString;
    this simple method calls the get methods for hours, minutes, seconds, and isAM. the compiler tells me i need another ) right before getSeconds(), but i don't believe it. i know this is a simple one, but i could use the advice.
    thanks.

    Hi,
    I was able to compile this method , it gave no error

  • What's wrong with my DII client code?

    I have the following WSDL for my ASP/IIS web service...
    <?xml version='1.0' encoding='UTF-8' ?>
    <!-- Generated 10/31/03 by Microsoft SOAP Toolkit WSDL File Generator, Version 3.00.1325.0 -->
    <definitions
         name='DCIS'
         targetNamespace='http://ds_00119/DCIS/wsdl/'
         xmlns:wsdlns='http://ds_00119/DCIS/wsdl/'
         xmlns:typens='http://ds_00119/DCIS/type/'
         xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
         xmlns:xsd='http://www.w3.org/2001/XMLSchema'
         xmlns:stk='http://schemas.microsoft.com/soap-toolkit/wsdl-extension'
         xmlns:dime='http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/'
         xmlns:ref='http://schemas.xmlsoap.org/ws/2002/04/reference/'
         xmlns:content='http://schemas.xmlsoap.org/ws/2002/04/content-type/'
         xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
         xmlns='http://schemas.xmlsoap.org/wsdl/'>
         <types>
              <schema
                   targetNamespace='http://ds_00119/DCIS/type/'
                   xmlns='http://www.w3.org/2001/XMLSchema'
                   xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
                   xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
                   elementFormDefault='qualified'>
                   <import namespace='http://schemas.xmlsoap.org/soap/encoding/'/>
                   <import namespace='http://schemas.xmlsoap.org/wsdl/'/>
                   <import namespace='http://schemas.xmlsoap.org/ws/2002/04/reference/'/>
                   <import namespace='http://schemas.xmlsoap.org/ws/2002/04/content-type/'/>
              </schema>
         </types>
         <message name='DCIS.CTXD'>
              <part name='bstrUser' type='xsd:string'/>
              <part name='bstrPassword' type='xsd:string'/>
              <part name='bstrName' type='xsd:string'/>
              <part name='bstrAddress' type='xsd:string'/>
              <part name='bstrPhone' type='xsd:string'/>
         </message>
         <message name='DCIS.CTXDResponse'>
              <part name='Result' type='xsd:string'/>
         </message>
         <portType name='DCISSoapPort'>
              <operation name='CTXD' parameterOrder='bstrUser bstrPassword bstrName bstrAddress bstrPhone'>
                   <input message='wsdlns:DCIS.CTXD'/>
                   <output message='wsdlns:DCIS.CTXDResponse'/>
              </operation>
         </portType>
         <binding name='DCISSoapBinding' type='wsdlns:DCISSoapPort' >
              <stk:binding preferredEncoding='UTF-8'/>
              <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
              <operation name='CTXD'>
                   <soap:operation soapAction='http://ds_00119/DCIS/action/DCIS.CTXD'/>
                   <input>
                        <soap:body
                             use='encoded'
                             namespace='http://ds_00119/DCIS/message/'
                             encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'
                             parts='bstrUser bstrPassword bstrName bstrAddress bstrPhone'/>
                   </input>
                   <output>
                        <soap:body
                             use='encoded'
                             namespace='http://ds_00119/DCIS/message/'
                             encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'
                             parts='Result'/>
                   </output>
              </operation>
         </binding>
         <service name='DCIS' >
              <port name='DCISSoapPort' binding='wsdlns:DCISSoapBinding' >
                   <soap:address location='http://ds_00119/DCIS/DCIS.ASP'/>
              </port>
         </service>
    </definitions>
    and the following client code...
    import javax.xml.namespace.*;
    import javax.xml.rpc.*;
    import javax.activation.*;
    import javax.mail.*;
    import com.sun.xml.messaging.saaj.*;
    import java.net.*;
    import java.util.*;
    import java.rmi.*;
    public class DIIClient
         public static void main(String[] args)
              try
                   String namespace = "http://ds_00119/DCIS/wsdl/";
                   String endpointURL = "http://ds_00119/DCIS/dcis.asp";
                   String portName = "DCISSoapPort";
                   String functionName = "CTXD";
                   String[] paramNames = {"bstrUser","bstrPassword","bstrName","bstrAddress","bstrPhone"};
                   String[] paramValues = new String[] {"x","y","a","b","c"};
                   String xsdStringType = "<xsd:string>";
                   ServiceFactory factory = ServiceFactory.newInstance();          
                   Call call = factory.createService(new QName("DCIS")).createCall();
                   call.setTargetEndpointAddress(endpointURL);
                   call.setPortTypeName(new QName(namespace, portName));
                   call.setOperationName(new QName(namespace, functionName));
                   call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
                   call.setProperty(Call.SOAPACTION_URI_PROPERTY, "http://ds_00119/DCIS/");
                   call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY, "");
                   call.setProperty(Call.OPERATION_STYLE_PROPERTY, "rpc");
                   for(int i=0; i<5; i++)
                        call.addParameter(paramNames, new QName(xsdStringType),ParameterMode.IN);
                   call.setReturnType(new QName(xsdStringType));          
                   String returnValue = (String) call.invoke(paramValues);
                   System.out.println(returnValue);
              catch(Exception ex)
              ex.printStackTrace();
    when I run this I get:
    java.rmi.RemoteException: WSDLReader:The operation requested in the Soap message with soapAction http://ds_00119/DCIS/action/DCIS isn't defined in the WSDL file. This may be because it is in the wrong namespace or has incorrect case
         at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:369)
         at DIIClient.main(DIIClient.java:45)
    I've tried everything I can think of for the soapAction string and just can't get it to work. What am I doing wrong here?
    I know the service works because I've been using C++ and VB clients for months, but I need to get a Java client up and running soon.
    I've only been looking at Java WS clients for a day, so if anyone knows of a better way to do this then please tell me! I've tried 4 completely different implementations so far and none of them worked.
    Chris

    Dear Chris,
    The problem is in your code itself or the way u've created this web service.
    I'm sending you some sample code. Just change the values of variables and delete unwanted lines according to you. Just go step by step.
    Here is the code
    import javax.xml.rpc.Call;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.JAXRPCException;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.ParameterMode;
    public class DllClient {
    private static String qnameService = "IPSProv_pipeService";
    private static String qnamePort = "IPSProv_pipeIFPort";
    private static String BODY_NAMESPACE_VALUE =
    "urn:Foo";
    private static String ENCODING_STYLE_PROPERTY =
    "javax.xml.rpc.encodingstyle.namespace.uri";
    private static String NS_XSD =
    "http://www.w3.org/2001/XMLSchema";
    private static String URI_ENCODING =
    "http://schemas.xmlsoap.org/soap/encoding/";
    public static void main(String[] args) {
    System.out.println("Endpoint address = http://218.248.33.59:8080/ipsprovPipeService/provision?WSDL");
    try {
    ServiceFactory factory =
    ServiceFactory.newInstance();
    Service service =
    factory.createService(
    new QName(qnameService));
    QName port = new QName(qnamePort);
    Call call = service.createCall(port);
    call.setTargetEndpointAddress("http://215.246.33.59:8080/ipsprovPipeService/provision?WSDL");
    call.setProperty(Call.SOAPACTION_USE_PROPERTY,
    new Boolean(true));
    call.setProperty(Call.SOAPACTION_URI_PROPERTY,
    call.setProperty(ENCODING_STYLE_PROPERTY,
    URI_ENCODING);
    QName QNAME_TYPE_STRING =
    new QName(NS_XSD, "string");
    call.setReturnType(QNAME_TYPE_STRING);
    call.setOperationName(
    new QName(BODY_NAMESPACE_VALUE,"sp_mgmnt"));
    call.addParameter("String_1", QNAME_TYPE_STRING,
    ParameterMode.IN);
    call.addParameter("String_2", QNAME_TYPE_STRING,
    ParameterMode.IN);
    call.addParameter("String_3", QNAME_TYPE_STRING,
    ParameterMode.IN);
    call.addParameter("String_4", QNAME_TYPE_STRING,
    ParameterMode.IN);
    String[] params = { "A","B"};
    String result = (String)call.invoke(params);
    System.out.println(result);
    } catch (Exception ex) {
    ex.printStackTrace();
    Plz show me the code after u make changes in it and do reply whether it works or not.
    Regards,
    Piyush

  • Can anyone tell me what is wrong with the simple sql?

    Hi,
    I have a simple SQL (see attached). It returns records when it does not include the Order By sorting clause. However, if it includes the Order By clause, Oracle says no data found. Anyone can give me some ideas what could cause the problem?
    Thanks in advance.
    SELECT ih.item_key, e.episode_key, e.episode_date, wp.work_package_key, p.patient_name, c.codes_key
    FROM work_package wp, episodes e, item_header ih, patients p, codes c, station_element se, station_data sd
    WHERE wp.work_item_key = e.episode_key
    and e.episode_key = ih.item_key
    and ih.logical_parent_key = p.patient_key
    and e.episode_type = c.code_value
    and wp.asgn_station_key = se.item_key
    and se.station_name like 'DICT FIX%'
    and sd.station_key = wp.asgn_station_key
    and (sd.facility = '0' or sd.facility = 1)
    and wp.on_hold <> 'Y' and c.code_type = 'CEPT'
    and c.setup_group = 1
    ORDER BY e.episode_date, e.medrec_no;

    Hmmm...can you post a SQL Plus session that demonstrates this?

  • What is wrong with my simple program!

    Hello everybody,
    I have a very simple Java program, but it could not run as i expect.
    Could anybody help me firgure it out ?
    Thank you very much in advance
    still_learn
    Here is my program:
    import java.io.*;
    public class Practice
    static InputStreamReader reader = new
    InputStreamReader(System.in);
    static BufferedReader keyboard = new BufferedReader
    (reader);
    public static void main(String[] args) throws
    IOException
    String response;
    do{
         System.out.println("");
         for(int i=0; i<20; i++)
         System.out.println("George Michael");
         do{
         System.out.print("Do you want to continue?
    (y/n) ");
         response = keyboard.readLine();
         }while((response != "y")&&(response != "n"));
              }while(response == "y");
    }// end of main
    }// end of class

    You didn't say what you expected, so debugging becomes very difficult. However I do notice at the end of the code that you compare two strings using == and !=. This does not work. If you want to see if two strings have the same content, use the equals() method of the String class. In your case:}while((!response.equals("y"))&&(!response.equals("n")));
    }while(response.equals("y");

  • What is wrong with this simple CFIF statement?

    Hi, I've included a simple cfif statment to check to see if a
    user is already in the database, for some reaons the <cfelse>
    part of the statement does not work. that is, if the user is there
    it returns the recordcount and ID etc. but if it is a new user (no
    records found) it is just blank (without the nothing doing !!!) any
    ideas?
    Thanks
    Yankee

    Based strictly on the code you have shown, you do not need
    the query="getuser" in your cfoutput tag.
    Also, I would check to see if the value is greater than zero
    rather than equal to one. What if the person has more than one
    record in the database?
    Try this...
    <CFIF getuser.recordcount GT 0>
    #GetUser.RecordCount# Records Found
    <CFELSE>
    Doing Nothing
    </CFIF>

  • What is wrong with this simple query

    Hi,
    I am writting a simple code just to get the maximum no values from a database table
    The query is
    ResultSet = stm.executeQuery("SELECT MAX(column_name) FROM Database_table ");
    it seems to be a simple one but i am getting the message
    column not found
    Please answer soon

    Well, it depends on how your resultset is retrieving the results. If you retrieve by column name, then that's your problem. You need to do something like this:
    ResultSet = stm.executeQuery("SELECT MAX(column_name) AS myColumnName FROM Database_table ");
    String myResult = ResultSet.getString(myColumnName);Using MAX, COUNT, etc, will return your result with a mangled or no actual column name to retrieve from. Optionally, you can solve your problem by:
    ResultSet.getString(1);Michael Bishop

  • What is wrong with my simple class program?

    Ok, I'm writing a simple class called 'Frog', which will keep track of the position enter by a user. The program will ask for the initial position for the frog. It will then ask for how many steps it want the frog to jump. Then it will output the new position of it. But for some reason, it doesn't work. It always output 0 for some reason.
    import java.io.*;
    import java.util.*;
    - frog program class.
    frog will start on a position.
    user will be prompt to ask how many jump to forward.
    public class beta
         public static void main(String args[]) throws IOException
              class Frog
              int newPos;
                   int Position () //return postion of the frog
                   return newPos;
                   void PositionStart (int newPos) //initial postion of the frog
                   newPos = newPos;
                   int Jump(int stepsForward, int newPos)
                        newPos+=stepsForward;
                        return newPos;
                   int PrevPos(int newPos)
                   return newPos-1;
                   int NextPos(int newPos)
                   return newPos+1;
                   boolean isMagicSquare(int newPos)
                        if(newPos == 5) return true;
                        else return false;
         BufferedReader key = new BufferedReader(new InputStreamReader(System.in));
         Frog joe = new Frog();
         int pos = 0, stepsFoward = 0;
                   //input 1-9
                   do
                        System.out.println("Enter a position for the frog: ");
                        pos = Integer.parseInt(key.readLine()); //reads in an integer
                   }while(pos < 1 || pos > 9);
                   joe.PositionStart(pos); //initialize the position for the frog
                   System.out.println("Pos: " + joe.Position()); //position
                   System.out.println("How many steps to jump: ");
                   stepsFoward = Integer.parseInt(key.readLine());
                   joe.Jump(stepsFoward,joe.Position());
                   System.out.println("New Position: " + joe.Position());               
    }

    You have method argument parameters with the same name as a member variable; as in:
    void PositionStart (int newPos) {
            newPos = newPos;
    }You need to identify to the compiler which variable is which, class member variables in cases like this should be qualified with the this keyword; as in:
    void PositionStart (int newPos) {
            this.newPos = newPos;
    }Dave

  • Please tell me what's wrong with this paypal buy code?

    <form id="form1" name="form1" method="post" action="">
              <p><form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="hosted_button_id" value="PBG8WAM6N6G2S">
    <table>
    <tr><td><input type="hidden" name="on0" value="&quot;Showtime&quot;-paper print">&quot;Showtime&quot;-paper print</td></tr><tr><td><select name="os0">
        <option value="1-11x14">1-11x14 $50.00</option>
        <option value="1-12x18">1-12x18 $65.00</option>
        <option value="1-16x20">1-16x20 $90.00</option>
        <option value="1-24x36">1-24x36 $170.00</option>
    </select> </td></tr>
    </table>
    <input type="hidden" name="currency_code" value="USD">
    <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
    <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
    </form>
    When I insert this code and try the "buy buttton" nothing happens.  My website is www.ritacortesi.com.  Paypal does not really have a good support website.

    HTML and/or DW Tutorials, and other information links that I have saved
    http://validator.w3.org/
    http://www.w3schools.com/
    http://www.hotscripts.com/
    http://webdesignledger.com/
    http://www.adobe.com/devnet/
    http://www.scriptarchive.com/
    http://www.htmldog.com/guides/
    http://www.htmlcodetutorial.com/
    http://alistapart.com/topics/code
    http://www.how-to-build-websites.com/
    http://css.maxdesign.com.au/floatutorial/
    Download User Guide as PDF for easy search
    http://www.adobe.com/support/documentation
    http://www.ianr.unl.edu/internet/mailto.html
    http://lynda.com/ Hours of videos. (must pay)
    http://apptools.com/examples/pagelayout101.php
    http://www.thesitewizard.com/archive/css.shtml
    http://www.projectseven.com/tutorials/index.htm
    If not PDF (link above) an online guide to read
    http://livedocs.adobe.com/en_US/Dreamweaver/9.0/
    Nate's Forms http://www.mindpalette.com/scripts/
    Customizing the layouts that come with CS3 (VIDEO)
    http://www.adobe.com/designcenter/video_workshop/?id=vid0155
    FormMail http://www.bebosoft.com/products/formstogo/index.php
    For those using MySQL - Installing PHP and MySQL on Windows XP
    http://www.webassist.com/professional/products/solutionrecipes.asp
    Community MX lessons http://www.communitymx.com/abstract.cfm?cid=3D074
    http://www.adobe.com/cfusion/designcenter/search.cfm?product=Dreamweaver&go=Go
    The Contact Form Solution Pack is only $29.99. To learn more, visit
    http://www.webassist.com/go/cfsp
    Web advisor extension to DW
    Date and Time through Javascript http://www.mediacollege.com/internet/javascript/date-time/
    Tutorial for building your first website:
    http://www.adobe.com/devnet/dreamweaver/articles/first_website_pt1.html
    Tutorial on building a dynamic website (one with a database):
    http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html
    HTM Color Codes
    http://www.visibone.com/
    or http://html-color-codes.com/
    or http://www.pagetutor.com/common/bgcolors1536.html
    or http://www.geocities.com/SiliconValley/Network/2397/

  • What is wrong with this simple for loop?

    long number = 12345678;
            for(int i=1;i<=numberOfDigits;i++)
                int i = number/(i);
            System.out.println(i);
            Basically, I want to take to assign int 1 = , int 2 = , int 3 = up until the number of digits.
    I still have to manipulate it, so the code makes no sesne, but how would I do that?
    So, i want to assign ints up until 8 but the manipulation I have also involves i up until the number of digits.
    Yhank you.

    Fredddir_Java wrote:
    I see that, but I just wanted to declare 8 ints (in this example, number of digits is 8) using a for loop, so I wanted to use the loop to assign these values one at a time. You know...but don't declare a variable with the same name as the loop variable. That just won't compile. Use an array as mentioned above.
    How would you do that?If you are trying to find the digit at a certain point in your number, probably the easiest way is to translate the number to a Stirng and use String methods (if allowed) such as charAt(...). If not, then look at the mod operator "%" and at integer division.
    Can anyone provide a basic loop for this task?Best not to ask for a code solution to homework here. We'll tolerate specific questions but not requests for code.

Maybe you are looking for