SP_SPACEUSED from MSSQL does not return two correct resultsets..

When running this query in MSSQL:
MSSQLStatement = this.Conexao.createStatement();
MSSQLStatement.execute("EXEC SP_SPACEUSED;")
It's always returning false, but only for this certain procedure....
I tried another queries like "SELECT * FROM SYSDATABASES; SELECT * FROM SYSDATABASES;" to simulate two resultsets and it worked fine...
Can anybody help? :)

You are welcome. The same occurs with Sybase ASE as well given MS SQL Server has its roots from Sybase SQL Server 4.2.
You will see similar issues with the TSQL print command as well. If you download a copy of Sybase jConnect, there is a sample2 directory which contains some trivial samples i wrote back in 1997 while working on the first release of jConnect. Many of the samples, such as the PrintExample.java should be relevant still to MS SQLServer i believe as i think they still handle the print command the same way as ASE.
Good luck

Similar Messages

  • Applet does not return a correct IP address

    I have an applet that when I run from within eclipse showes me my correct IP address. However as soon as I inserted this applet into JSP file I started to get just 127.0.0.1 address, always.
    What am I doing wrong ?
    import java.applet.Applet;
    import java.awt.Graphics;
    public class IPgetter extends Applet {
         public void paint(Graphics g) {
          try {
              String host_ip = java.net.InetAddress.getLocalHost().getHostAddress();
              g.drawString("Your IP address is "+host_ip,5,25);
          catch (Exception e){
    }You can see this at : http://difrad.com/difrad/example2.jsp

    Well, it is a real IP address. It's just not the one you want.
    Try this: use java.net.NetworkInterface.getNetworkInterfaces() to get a bunch of NetworkInterface objects. Then for each one you call getInetAddresses.
    You're working your way through enumerations of enumerations, but you can apply some heuristics to find the address you want.

  • DATE type returned from function does not return the time component

    Hi,
    I'm dealing with a strange problem. I have a PL/SQL function (running on Oracle 8.1.4.7) which returns a DATE value. Like we all know the DATE datatype includes a date component and a time component.
    The function I used for testing is like this:
    FUNCTION ReturnDate return Date is
    dReturn Date;
    Begin
    select sysdate into dReturn from dual;
    return dReturn;
    end ReturnDate;
    When I call this function from .NET using ODP.NET the date value I get does not have the time component included only the day-month-year components.
    This is a code-snippet that calls the function :
    command.CommandText="Schema.ReturnDate";
    command.CommandType=CommandType.StoredProcedure;
    command.Parameters.Add("Return_Value",
    OracleDbType.Date,0,ParameterDirection.ReturnValue);
    command.ExecuteNonQuery();
    I use the OracleDbType.Date type which I think is the most logical choice, because the type in the Database is after all DATE.
    However this does not include the time componet. But if I change the OracleDbType.Date to OracleDbType.TimeStamp I get the time component. I'm not happy with this "hack" because I'm not sure what will happen when we upgrade our version of the Database to Oracle 9i which uses the new TimeStamp datatype.
    Is this a bug that the OracleDbType.Date does not include the time component??

    How do you examine the output Date value?
    If it is from the string, then the time components will
    not show because the NLS_DATE format in the client
    machine does not contain the time components.
    In American, the Date format is 'DD-MON-RR' by default whereas, the TimeStamp format is 'DD-MON-RR HH.MI.SSXFF AM' by default.
    Can you take a look at the time components from the OracleDate by accessing the time properties, eg. OracleDate.Hour, OracleDate.Minute..etc to see if the time values are there?
    Thanks
    Martha

  • Query.cmd  -s -c -l "select * from ' cachename '" does not return results

    We are working with coherence 3.6.1 on RH5 server. We are connecting to the grid and are able to query a cache through the command line. However, when we attempt to query a cache utilizing the following command, we receiving only the CohQL prompt:
    query.cmd -s -c -l "select * from '<a cache>'"
    This works on the UNIX side with the query.sh command.
    Additionally:
    redirect to a file = same issue
    input from a file = same issues
    input from a file, redirect to a file = same issue
    etc....
    The examples are OK, it just does not work as expected.
    Thanks!!!

    We have been able to get the file input to file output to work
    query.cmd -s -t -f < myinputfile -f > myoutputfile
    still cannont get the
    query.cmd -l "select * from 'mycache'" to work

  • Ldapsearch does not return the correct result

    We are using the Netscape Directory server 4.12. We try to use the Radiator Radius server to query the Directory server for authentication.
    When we use the filter:
    uid=itkychan
    to query if the user is in the Directory, it returns the correct result.
    However, we would like to query if the username is in a specified group, e.g. tss_ns_grp, in the Directory, we try to use the following command:
    #./ldapsearch -b "o=The xxx University,c=HK" -h hkpu19
    "(&(cn=tss_ns_grp)(|(&(objectclass=groupofuniquenames)(uniquemember=uid=itkychan))(&(objectclass=groupofnames)(member=uid=itkychan))))"
    but no result is returned.
    itkychan is a member of the group tss_ns_grp. The following is a portion of the LDIF file:
    dn: cn=tss_ns_grp, o=The xxx University, c=HK
    objectclass: top
    objectclass: groupOfUniqueNames
    objectclass: mailGroup
    cn: tss_ns_grp
    mail: [email protected]
    mailhost: abcd.xxxu.edu.hk
    uniquemember: cn=xxxxxxxxxxxxxx, uid=itkychan, ou=xxxu_ITS, o=The xxx University, c=HK
    uniquemember: cn=xxxxxxxxxxxxxx, uid=itjcheng, ou=polyu_ITS, o=The xxx University, c=HK
    uniquemember: .....

    You will have to use the full DN for the member and uniquemember e.g.
    (...(uniquemember=cn=xxxxxxxxxxxxxx, uid=itkychan, ou=xxxu_ITS, o=The xxx University, c=HK)...)

  • PLSQL function does not return the correct number of rows?

    Hey folks. I'm still green when it comes to writing PLSQL. It's fun, rewarding and very frustrating. Hence, I'm turning to the experts. If you folks can help me understand what I'm doing wrong here, I'd really appreciate it.
    The code is somewhat specific to my company's product, but I think it should be easy to read and understand what I'm doing. If not, please let me know what I can clarify.
    All i'm trying to do is determine if the most recent iteration of data available for a particular host is a full scan or not (level2). I go about this in the following manner:
    1. get the operatingsystem id, it's scandate (preferred), the most recent scandate and it's scan status from a table of where all operating systems data lives. Loop through all the Oses
    (from this I set v_osid, v_mostrecentscandate, v_scandate).
    2. Before doing the crazy logic, pick the low hanging fruit
    2a. if the the level2 status of the host is N, then v_level2 = 'N';
    2b. if the level2 = 'Y' and the mostrecentscandate and scandate are identical, then v_level2 = 'Y';
    2c. for all other cases, go to 3
    3. Using v_mostrecentscandate, find all table id that may hold the most recent instance of data for the host
    4. Loop through through the concatenation of that id + _base. If you find the id in those tables, then store the id for the next step.
    5. When you I find the right id, I now concatenate the id + attrdata. For the host id, I look for any rows where attribute_value in (..) and the corresponding number_value is not null.
    5b. set v_level2 = 'Y'
    5c. otherwise, set v_level2 = 'N'
    6 end the loop
    7 wash, rinse, repeat for each OS.
    create or replace package body mostrecentlevel2 as
    function getMostRecentL2 return bdna_mostrecent_level2 pipelined IS
    v_lsid NUMBER;
    v_sql VARCHAR2(5000);
    v_sql_baseid NUMBER;
    v_sql_numv NUMBER;
    v_lsidt VARCHAR2(5000);
    v_lsidt2 VARCHAR2(5000);
    v_sql_rec VARCHAR2(5000);
    v_osid NUMBER;
    v_anchor DATE;
    v_ls CHAR(2);
    v_level2 CHAR(1);
    v_mostrecentscandate DATE;
    v_scandate DATE;
    cursor getOSinfo_cur is select operatingsystem_id, scandate, mostrecentscandate, level2 from bdna_all_os;
    cursor getlsID_cur is select id from local_scan where
              ((trunc(collect_start_time) - to_date(v_anchor))*24*60*60) <= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60)
              and
              ((trunc(collect_end_time) - to_date(v_anchor))*24*60*60) >= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60);
    getOSinfo_rec getOSinfo_cur%rowtype;
    getlsID_rec getlsID_cur%rowtype;
    BEGIN
    v_ls := 'ls';
    v_anchor := '01-JAN-01';
    FOR getOSinfo_rec IN getOSinfo_cur LOOP
         v_osid := getOSinfo_rec.operatingsystem_id;
         v_mostrecentscandate := getOSinfo_rec.mostrecentscandate;
         v_scandate := getOSinfo_rec.scandate;
         IF getOSinfo_rec.level2 = 'N' THEN
              v_level2 := 'N';
         ELSIF getOSinfo_rec.level2 = 'Y' THEN
              IF v_mostrecentscandate != v_scandate THEN
                   FOR getlsID_rec IN getlsID_cur LOOP
                        v_lsid := getlsID_rec.id;
                        v_lsidt := v_ls||v_lsid;
                        v_sql := 'select id from '||v_lsidt||'_base where id = '||chr(39)||v_osid||chr(39);
                        EXECUTE IMMEDIATE v_sql into v_sql_baseid;
                        IF SQL%ROWCOUNT > 0 THEN
                             v_lsidt2 := v_lsidt;
                             v_sql := '';
                        END IF;
                   END LOOP;
                   v_sql := 'select number_value from '||v_lsidt2||'_attr_data where
                             lower(attribute_name) IN ('||chr(39)||'numcpus'||chr(39)||', '||chr(39)||'totalmemory'||chr(39)||', '||chr(39)||'cpuutilpercent'||chr(39)||', '||chr(39)||'numprocesses'||chr(39)||')
                             and
                             number_value is not NULL
                             and
                             element_id = '||chr(39)||v_osid||chr(39);
                   EXECUTE IMMEDIATE v_sql into v_sql_numv;
                   IF SQL%ROWCOUNT > 0 THEN
                        v_level2 := 'Y';
                   ELSE v_level2 := 'N';
                   END IF;
              END IF;
              v_level2 := 'Y';
         END IF;
         PIPE ROW (mostRecentLevel2Format(v_osid,v_mostrecentscandate,v_level2));
    END LOOP;
    END;
    END;
    /Now some will ask why I'm using pipelining? Again, I'm green.. I was reading around, looking for a way to make this code run as fast as possible (because it's potentially got to go through 56K records and perform the expensive work on).
    I also realize I'm not providing the type or package code, and that's because I think I'm good on that. The code above compiles just fine without errors and when it runs, it only returns 6 consecutive rows.. I'm expecting 70K lol. So I know I'm doing something wrong.
    Any thoughts?
    Oh forgot to add this is on 11g R1 Enterprise Edition
    Edited by: ErrolDC on Nov 14, 2011 4:52 PM
    Edited by: ErrolDC on Nov 14, 2011 5:07 PM

    ErrolDC wrote:
    Hey folks. I'm still green when it comes to writing PLSQL. It's fun, rewarding and very frustrating. Hence, I'm turning to the experts. If you folks can help me understand what I'm doing wrong here, I'd really appreciate it.
    The code is somewhat specific to my company's product, but I think it should be easy to read and understand what I'm doing. If not, please let me know what I can clarify.Post a complete script that peoople who aren't as familiar with the application as you are can run to re-create the problem and test their ideas. In this case, that includes CREATE TABLE and INSERT statements for the tables used (just the columns needed for this job), a query that uses the function, and the results you want from that query given the data you posted.
    All i'm trying to do is determine if the most recent iteration of data available for a particular host is a full scan or not (level2). I go about this in the following manner:
    1. get the operatingsystem id, it's scandate (preferred), the most recent scandate and it's scan status from a table of where all operating systems data lives. Loop through all the Oses
    (from this I set v_osid, v_mostrecentscandate, v_scandate).
    2. Before doing the crazy logic, pick the low hanging fruit
    2a. if the the level2 status of the host is N, then v_level2 = 'N';
    2b. if the level2 = 'Y' and the mostrecentscandate and scandate are identical, then v_level2 = 'Y';
    2c. for all other cases, go to 3
    3. Using v_mostrecentscandate, find all table id that may hold the most recent instance of data for the host
    4. Loop through through the concatenation of that id + _base. If you find the id in those tables, then store the id for the next step.
    5. When you I find the right id, I now concatenate the id + attrdata. For the host id, I look for any rows where attribute_value in (..) and the corresponding number_value is not null.
    5b. set v_level2 = 'Y'
    5c. otherwise, set v_level2 = 'N'
    6 end the loop
    7 wash, rinse, repeat for each OS.
    create or replace package body mostrecentlevel2 as
    function getMostRecentL2 return bdna_mostrecent_level2 pipelined IS
    v_lsid NUMBER;
    v_sql VARCHAR2(5000);
    v_sql_baseid NUMBER;
    v_sql_numv NUMBER;
    v_lsidt VARCHAR2(5000);
    v_lsidt2 VARCHAR2(5000);
    v_sql_rec VARCHAR2(5000);
    v_osid NUMBER;
    v_anchor DATE;
    v_ls CHAR(2);
    v_level2 CHAR(1);
    v_mostrecentscandate DATE;
    v_scandate DATE;
    cursor getOSinfo_cur is select operatingsystem_id, scandate, mostrecentscandate, level2 from bdna_all_os;
    cursor getlsID_cur is select id from local_scan where
              ((trunc(collect_start_time) - to_date(v_anchor))*24*60*60) <= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60)
              and
              ((trunc(collect_end_time) - to_date(v_anchor))*24*60*60) >= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60);
    getOSinfo_rec getOSinfo_cur%rowtype;
    getlsID_rec getlsID_cur%rowtype;
    BEGIN
    v_ls := 'ls';
    v_anchor := '01-JAN-01';
    FOR getOSinfo_rec IN getOSinfo_cur LOOP
         v_osid := getOSinfo_rec.operatingsystem_id;
         v_mostrecentscandate := getOSinfo_rec.mostrecentscandate;
         v_scandate := getOSinfo_rec.scandate;
         IF getOSinfo_rec.level2 = 'N' THEN
              v_level2 := 'N';
         ELSIF getOSinfo_rec.level2 = 'Y' THEN
              IF v_mostrecentscandate != v_scandate THEN
                   FOR getlsID_rec IN getlsID_cur LOOP
                        v_lsid := getlsID_rec.id;
                        v_lsidt := v_ls||v_lsid;
                        v_sql := 'select id from '||v_lsidt||'_base where id = '||chr(39)||v_osid||chr(39);
                        EXECUTE IMMEDIATE v_sql into v_sql_baseid;
                        IF SQL%ROWCOUNT > 0 THEN
                             v_lsidt2 := v_lsidt;
                             v_sql := '';
                        END IF;
                   END LOOP;
                   v_sql := 'select number_value from '||v_lsidt2||'_attr_data where
                             lower(attribute_name) IN ('||chr(39)||'numcpus'||chr(39)||', '||chr(39)||'totalmemory'||chr(39)||', '||chr(39)||'cpuutilpercent'||chr(39)||', '||chr(39)||'numprocesses'||chr(39)||')
                             and
                             number_value is not NULL
                             and
                             element_id = '||chr(39)||v_osid||chr(39);
                   EXECUTE IMMEDIATE v_sql into v_sql_numv;
                   IF SQL%ROWCOUNT > 0 THEN
                        v_level2 := 'Y';
                   ELSE v_level2 := 'N';
                   END IF;
              END IF;
              v_level2 := 'Y';
         END IF;
         PIPE ROW (mostRecentLevel2Format(v_osid,v_mostrecentscandate,v_level2));
    END LOOP;
    END;
    END;
    /Now some will ask why I'm using pipelining? Again, I'm green.. I was reading around, looking for a way to make this code run as fast as possible (because it's potentially got to go through 56K records and perform the expensive work on).
    I also realize I'm not providing the type or package code, and that's because I think I'm good on that. The code above compiles just fine without errors and when it runs, it only returns 6 consecutive rows.. I'm expecting 70K lol. So I know I'm doing something wrong. You're calling TO_DATE with a DATE argument. Why are you calling TO_DATE at all?
    It seems like this condition:
    ((trunc(collect_start_time) - to_date(v_anchor))*24*60*60) <= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60) is equivalent to
    TRUNC (collect_start_time) <= v_mostrecentscandateThat probably has nothing to do with why you're only getting 6 rows.

  • Discovery seach does not return the correct messages

    We're trying to produce what I thought would be simple reports on the entire mail database. We have a simple single Exch2010 box. When using the discovery search tool, it is returning WAY too much of the wrong info. I just want to put in keywords, restrict
    the FROM to a single @domain.com and limit by date. It seems like the tool would do such a simple thing, but it doesn't seem to filter out on the FROM at all. It just does the keywords and dates. Without the limit on the From domain there are thousands of
    incorrect hits.
    I have the latest CU's, the user is definitely part of the discovery role group, it works on just keywords, but its just spewing all kinds of useless information. Anyone have any ideas? I really don't use powershell and would prefer not to since I have a
    bunch of these to do in various options, but I can't trust the data.
    Curt Kessler - FLC

    Hi Curt,
    To know more about the issue, could you please let me know the search query you specified which give unexpected result? Since you mentioned you don’t want to use shell, are you using ECP? When
    perform the search, how did you specify the “Keywords” and “Messages To or From Specific E-mail Address”? Which mailbox did you use as the destination mailbox to store the search result?
    I recommend not choose the “Include items that can’t be searched” and “Enable deduplication” option. Please try again and give me a screenshot of the result
    if still other emails from other senders appear in the search result. Please set the keywords as format
    “Keywords”1 AND (“Keywords2” OR “Keywords3”)
    Note: If we only specify one keywords, what’s the result? Please test and check.
    Meanwhile, to narrow down the issue, it’s recommend to use shell to search, it’s useful to test the issue and verify if the same result using the same search queries and still emails form other
    senders appear. For example:
    New-MailboxSearch -Name "Search-20140307" -TargetMailbox “Target mailbox to store the search result” -StartDate "01/01/2014" -EndDate "03/07/2014" -Senders "sender
    email address or domain name" -SearchQuery "search keywords" -ExcludeDuplicateMessages
    For more information about discovery search, we can refer to the following articles:
    Title: Mailbox Search
    Link1:
    http://technet.microsoft.com/en-us/library/dd298064(v=exchg.141).aspx
    Link2:
    http://technet.microsoft.com/en-us/library/dd335072(v=exchg.141).aspx#PDS
    Link3:
    http://www.msexchange.org/articles-tutorials/exchange-server-2010/compliance-policies-archiving/managing-multi-mailbox-search-exchange-server-2010-part2.html
    Regards, Eric Zou

  • Zip data posted from client does not show up correctely at Server

    The java client post GZip'd data to the Webserver. The webserver for some reason shows the first 10 bytes correctly. Not sure what I am overlooking
    Also get java.io.EOFException: Unexpected end of ZLIB input stream
    public class GetPost {
         public String line;
         public String inputLine;
    public static void main(String[] args) throws Exception {
              GetPost r = new GetPost();
                   r.postURL("User","pass");
    // public Reverse { }
    public static byte [] zip(String data)
    throws IOException
    byte[] incomingBytes = data.getBytes();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    GZIPOutputStream zip = new GZIPOutputStream(baos);
    for (int i = 0; i < incomingBytes.length; i++)
    zip.write(incomingBytes[i] & 0xFF);
    zip.close();
    byte[] uncompressedBytes = baos.toByteArray();
    return uncompressedBytes;
    public static String unzip(byte [] dataBytes)
    throws IOException
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ByteArrayInputStream bios = new ByteArrayInputStream(dataBytes);
    GZIPInputStream unzip = new GZIPInputStream(bios);
    int in = unzip.read();
    while (in != -1)
    baos.write(in);
    in = unzip.read();
    unzip.close();
    return new String(baos.toByteArray());
    public String postURL( String t1 , String t2 ){
    try {
              String data1="h";
    URL urlpost = new URL("http://192.168.15.4:8080/result.html");
         URLConnection conn = urlpost.openConnection();
         conn.setDoOutput(true);
         GZIPOutputStream gz = new GZIPOutputStream(conn.getOutputStream());
         byte [] kkkk=zip(data1);
         String uuu=unzip(kkkk);
         System.out.println("XXXXX" + uuu );
         for (int i=0; i< kkkk.length ; i++){
              Byte jj= new Byte(kkkk);
              System.out.println("LLLL " + " " + i + " " + jj );
         int t= kkkk.length;
         System.out.println("IIII" + t);
         int x= data1.getBytes().length;
         gz.write(kkkk);
         gz.finish();
         gz.close();
         // Get the response
         BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
         while ((line = rd.readLine()) != null) {
         // Process line...
         System.out.println ("The line is " + line );
         } catch (Exception e) {
              return line;
    The client output is
    LLLL 0 31
    LLLL 1 -117
    LLLL 2 8
    LLLL 3 0
    LLLL 4 0
    LLLL 5 0
    LLLL 6 0
    LLLL 7 0
    LLLL 8 0
    LLLL 9 0
    LLLL 10 -53
    LLLL 11 0
    LLLL 12 0
    LLLL 13 -25
    LLLL 14 6
    LLLL 15 107
    LLLL 16 -111
    LLLL 17 1
    LLLL 18 0
    LLLL 19 0
    LLLL 20 0
    Server output is correct only for the first 10 bytes
    LLLL 0 31
    LLLL 1 -117
    LLLL 2 8
    LLLL 3 0
    LLLL 4 0
    LLLL 5 0
    LLLL 6 0
    LLLL 7 0
    LLLL 8 0
    LLLL 9 0
    LLLL 10 -53
    LLLL 11 0
    LLLL 12 0
    LLLL 13 -25
    LLLL 14 6
    LLLL 15 107
    LLLL 16 -111
    LLLL 17 1
    LLLL 18 0
    LLLL 19 0
    LLLL 20 0

    FYI - I got it to work ... I was gzip it twice... here is what worked
    import java.io.BufferedReader;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.URL;
    import java.net.URLConnection;
    import java.net.URLEncoder;
    import java.util.zip.*;
    import java.io.OutputStreamWriter;
    public class WorkingCopyOfGetPost {
         public String line;
         public String inputLine;
    public static void main(String[] args) throws Exception {
              WorkingCopyOfGetPost r = new WorkingCopyOfGetPost();
                   r.postURL("User","pass");
    // public Reverse { }
    public static byte [] zip(String data) throws IOException {
         byte[] incomingBytes = data.getBytes();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         GZIPOutputStream zip = new GZIPOutputStream(baos);
         for (int i = 0; i < incomingBytes.length; i++){
              zip.write(incomingBytes[i] & 0xFF);
         zip.close();
         byte[] uncompressedBytes = baos.toByteArray();
         return uncompressedBytes;
    public static String unzip(byte [] dataBytes) throws IOException {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ByteArrayInputStream bios = new ByteArrayInputStream(dataBytes);
         GZIPInputStream unzip = new GZIPInputStream(bios);
         int in = unzip.read();
         while (in != -1){
              baos.write(in);
              in = unzip.read();
         unzip.close();
         return new String(baos.toByteArray());
    public static ByteArrayOutputStream zip1(String data) throws IOException {
              byte[] incomingBytes = data.getBytes();
              ByteArrayOutputStream baos = new ByteArrayOutputStream();
              GZIPOutputStream zip = new GZIPOutputStream(baos);
              for (int i = 0; i < incomingBytes.length; i++){
                   zip.write(incomingBytes[i] & 0xFF);
              zip.close();
              //byte[] uncompressedBytes = baos.toByteArray();
              return baos;
    public String postURL( String t1 , String t2 ){
         String data1="t";
         try {
              /* byte [] kkkk=zip(data1);
              for (int x=0;x<20;x++){
                   System.out.println("Byte Array Values " + x + kkkk[x] );
              ByteArrayOutputStream bo= zip1(data1);
              byte [] AAA=bo.toByteArray();
              for (int x=0;x<21;x++){
                   System.out.println("Byte Array Values " + x + " "+ AAA[x] );
              URL urlpost = new URL("http://192.168.15.4:8080/result.html");
         URLConnection conn = urlpost.openConnection();
         conn.setDoOutput(true);
         System.out.println( "The size of the byteArrayOutputstream " + bo.size() );
         bo.writeTo(conn.getOutputStream());
         // GZIPOutputStream gz = new GZIPOutputStream(conn.getOutputStream());
         // System.out.println("rrrr " + kkkk.length);
         // gz.write(kkkk);
         //gz.finish();
         //gz.flush();
         bo.flush();
         // String s=unzip(kkkk) ;
         //System.out.println("s " + s);
         // Get the response
         BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
         while ((line = rd.readLine()) != null) {
         // Process line...
         System.out.println ("The line is " + line );
         rd.close();
         bo.close();
         } catch (Exception e) {
              return line;
    }

  • HttpServletRequest.getHeaders("accept") does not return the correct results

    I noticed that when I use the invoke the HttpServletRequest.getHeaders("accept") method I do not get the result that I am expecting.
    For instance, if the browser passes over the following accept header:
    "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"
    When i invoke the getHeaders() method, instead of it returning me a single value with the string that was passed over, it returns me 4 separate entries. It looks like Iplanet is parsing the header value and breaking it up by commas.
    When I run the same code in TomCat, it returns the single comma separated string as I would expect.
    Is there anything to keep Iplanet from breaking apart the header value?
    I am running Oracle iPlanet Web Server 7.0.15 B04/19/2012 21:52
    Thanks In Advance,
    Marty
    Edited by: MartyJones2 on Aug 30, 2012 2:44 PM

    You will have to use the full DN for the member and uniquemember e.g.
    (...(uniquemember=cn=xxxxxxxxxxxxxx, uid=itkychan, ou=xxxu_ITS, o=The xxx University, c=HK)...)

  • Why does not return the correct color?

    I have a resources dictionary with a color:
    <SolidColorBrush x:Key="MyColorWhenSelected" Color="{Binding Source={x:Static SystemColors.HighlightBrush}}"/>
    I have added this resources to App.Current.Resources.MergedDictionaries.
    Later, in my converter to set the background in a listview, I return:
    return App.Current.Resources["MyColorWhenSelected"]
    But the item has a white color, is not blue like the defult selected color.
    However, if I return:
    return System.Windows.SystemColors.HighlightBrush
    Then the color is the expected one.
    I have tried another color from my dictionary, por example:
    <SolidColorBrush x:Key="TestColor" Color="White" />
    If I return
    return App.Current.Resources["MyColorWhenSelected"]
    this works as expected.
    I guess that the problem is because in this second case all is SolidColorBrush type, while in the first case one is SolidColorBrush and the other is SystemColors.
    My idea is to use the resource dictionary because if in the future I decide to change the highlight color, change it in this resource, and not to change in all the converters in which I use this color.
    Thank so much.

    There is an error in your binding. You should bind to the Color property of the HighlightBrush:
    <SolidColorBrush x:Key="MyColorWhenSelected" Color="{Binding Path=Color, Source={x:Static SystemColors.HighlightBrush}}"/>
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question.

  • FileReader does not return the correct byte value of the characters

    I have some text in a very old persian code page and all I have from this code page is numerical table of the characters(like ASCII table).
    With a HashMap, the equivalent Unicode characters are mapped to the numerical values. With using FileInputStream and its read() method, it converts corretly;
    but by using the FileReader (following code snippet), just a few characters cannot be read correctly so it cannot be mapped correctly either.(I tryed several encodings too)
    FileReader in = new FileReader("inputFile");
    BufferedReader b = new BufferedReader(in);
    Stirng s = b.readLine();
    byte[] by = s.getBytes("encoding");
    I need to work with strings for conversion; so is ther any solution for it?

    I have some text in a very old persian code page and
    all I have from this code page is numerical table of
    the characters(like ASCII table).
    With a HashMap, the equivalent Unicode characters are
    mapped to the numerical values. With using
    FileInputStream and its read() method, it converts
    corretly;
    but by using the FileReader (following code snippet),
    just a few characters cannot be read correctly so it
    cannot be mapped correctly either.(I tryed several
    encodings too)
    FileReader in = new FileReader("inputFile");
    BufferedReader b = new BufferedReader(in);
    Stirng s = b.readLine();
    byte[] by = s.getBytes("encoding");
    I need to work with strings for conversion; so is ther
    any solution for it?Use FileInputStream to read the data into bytes, then use your mapping to convert bytes to characters. Then create a string representation by appending the characters to a StringBuffer. You can't use FileReader because readers convert bytes to characters using a character encoding, which you don't have.

  • Res.getPathTranslated() does not return correct URL of the page requested

    Hi,
    The res.getPathTranslated() statement in the below code (in doFilter method) does not return the correct URL of the requested webpage.
    Whenever a web page is accessed using a return statement (eg : return "nextPage"; ) inside a button's action method or a hyperlink's action method, the res.getPathTranslated() returns the URL of the current webpage instead of returning the URL of the webpage that is actually requested.
    For example if there is a button on the page http://localhost:29080/MyJaas/faces/firstPage.jsp
    And the button_action() is as follows
    button_action()
    return "nextPage";
    The res.getPageTranslaged() returns "http://localhost:29080/MyJaas/faces/firstPage.jsp" instead of "http://localhost:29080/MyJaas/faces/nextPage.jsp"
    However, if the webpage is requested by populating the URL property of the hyerlink in creator IDE, the res.getPathTranslated() returns the correct (requested) web page.
    How to make res.getPathTranslagted() return the correct URL when the webpage is accessed from hyperlink's / button's action method?
    I know that the explation is not very clear, so please bear with me. Let me know if you need more clarificatons. Thanks in advance for showing interest in this issue.
    And by the way, the code below is the same as that used in Jaas Authentication tutorial :- http://developers.sun.com/prodtech/javatools/jscreator/reference/techart/2/jaas_authentication.html
    package jaasauthentication;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.http.HttpSession;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class SecurityFilter implements Filter{
        /** Creates a new instance of SecurityFilter */
        private final static String FILTER_APPLIED = "_security_filter_applied";
        public SecurityFilter() {
        public void init(FilterConfig filterConfig) {
        public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException{
            HttpServletRequest req = (HttpServletRequest)request;
            HttpServletResponse res = (HttpServletResponse)response;
            HttpSession session = req.getSession();
            String requestedPage = req.getPathTranslated();
            String user=null;
            //We dont want to filter certain pages which include the Login.jsp/Register.jsp/Help.jsp
            if(request.getAttribute(FILTER_APPLIED) == null) {
                //check if the page requested is the login page or register page
                if((!requestedPage.endsWith("Login.jsp")) && (!requestedPage.endsWith("Register.jsp")) && (!requestedPage.endsWith("Help.jsp"))){
                    //Requested page is not login.jsp or register.jsp therefore check for user logged in..
                    //set the FILTER_APPLIED attribute to true
                    request.setAttribute(FILTER_APPLIED, Boolean.TRUE);
                    //Check that the session bean is not null and get the session bean property username.
                    if(((jaasauthentication.SessionBean1)session.getAttribute("SessionBean1"))!=null) {
                        user = ((jaasauthentication.SessionBean1)session.getAttribute("SessionBean1")).getUsername();
                    if((user==null)||(user.equals(""))) {
                        res.sendRedirect("Login.jsp");
                        return;
            //deliver request to next filter
            chain.doFilter(request, response);
        public void destroy(){
    }

    Guys any solution for the above problem?
    Right answer fetches 10 duke dollars..

  • MessageChoice does not return correct value

    Hi
    I am problem with MessgeChoiceBean's improver beharior
    For the first time it retunrs blank and subsequently In one page if I select Yes, it returns No.
    In another page it does not return any thing for the first two selections. And I reciev flip values.
    I ran VO outside, VO is returning correct values.
    MessageChoice attributes and associated PPR:
    Data Type: Varchar2
    Initial Value: N
    Pick List view Definition: oracle.apps.xxx.docs.common.lov.server.YesNoVO
    Pick List View Instance: YesNoVO3
    Pick List Display Attribute: Meaning
    Pick List Value AttributeL LookupCode
    ActionType: firePartialAction
    Event: handleNewLocationFlagChange
    Parameter Name: newLocationFlag
    Parameter Value: ${oa.CustomerInfoVO1.NewShipToLocationFlag}
    ProcessParameterForm Code:
    if ("handleNewLocationFlagChange".equals(event))
    String newLocationFlag = pageContext.getParameter("newLocationFlag");
    Serializable[] parameters = { ""+newLocationFlag};
    Class[] paramTypes = { String.class};
    am.invokeMethod("handleNewLocationFlagChange", parameters, paramTypes);
    VO definition:
    select LOOKUP_CODE,MEANING
    FROM ONLINE_DOCS_LOOKUPS
    WHERE ONLINE_DOCUMENT_CODE = 'ALL'
    AND LOOKUP_TYPE = 'YESNO'
    ORDER BY ATTRIBUTE1
    View output:
    LOOKUP_CODE     MEANING
    N     No
    Y     Yes
    I have quite a bit number of columns to change render property.
    Any help will be appreciated.
    Thanks
    Prasad

    Your question is not clear, are you saying the values in the messageChoiceBean is not displayed properly. As far as I can see from the definition the poplist picks the values from a lookup(Yes, No) values and has a PPR action associated with it. Did you check what this method handleNewLocationFlagChange is doing in the AM ?

  • My PC does not return to the source document I print from

    I had a setting control for
    this in XP but can't find the page I got it from.<o:p></o:p>
    <o:p> </o:p>
    In ANY application or browser
    this happens.  I print from a specific Excel workbook, by example, when I
    have a number of them open.  The system does not return to the workbook I
    printed from.  This is maddening and causes all kinds of issues.
     Searching the web for this now produces nothing and I know I can't be the
    only person who experiences this.<o:p></o:p>
    <o:p> </o:p>
    This is a Windows 7 platform
    in a networked business environment.  I'm running the Classic Menu add-in
    from Addintools because I can't stand the ribbon and have never liked it.
     In Windows 7, I'm running a couple of other add-ins that restore the XP
    use of the task bar properly so one can work efficiently.<o:p></o:p>
    <o:p> </o:p>
    None of the add-ins are what
    is causing this issue because I'd run the same Classic Menu add-in on the XP
    box and it had the same issue until I found the work-around that I can't
    remember now.<o:p></o:p>
    <o:p> </o:p>
    Has anyone else experienced
    this issue?<o:p></o:p>
    <o:p> </o:p>
    Jeff Lynch<o:p></o:p>

    Hi,
    "I print from a specific Excel workbook, by example, when I
    have a number of them open.  The system does not return to the workbook I
    printed from."
    If I'm not misunderstanding, do you mean that the workbook is automatically closed after you print from that workbook, right?
    As I know, if we use the default ribbon in Excel, no matter in Windows XP or Windows 7, the opened workbook should be stay opened after you print from that Excel workbook.
    So the question is that: what is the version of office? What is the Classic Menu add-in you're running now? Did you manually download and install it to your system? Could you please share a picture with us about the add-ins you're using?
    Yolanda Zhu
    TechNet Community Support

  • When using rabbitmq-jms for vFabric RabbitMQ javax.jms.Message.getJMSDestination does not return the actual destination when it is received from a consumer listening on a Topic with a wild card

    When using rabbitmq-jms for vFabric RabbitMQ javax.jms.Message.getJMSDestination does not return the actual destination when it is received from a consumer listening on a Topic with a wild card. I have tested with both 1.0.3 and 1.0.5 clients with RabbitMQ 3.1.5.
    I was wondering if the community was aware of this problem and if there are any workarounds? If not what is the proper channel to file a bug report. An example code snippet is below. The test fails because the TextMessageMatcher expects the destination passed in on construction (second parameter) to equal the desination on the message received (aquired from getJMSDestination).
            Mockery context = new Mockery();
            final MessageListener messageListener = context.mock(MessageListener.class);
            final Latch latch = new LatchImpl();
            final String prefix = "test" + System.currentTimeMillis();
            context.checking(new Expectations() {
                    oneOf(messageListener).onMessage(with(new TextMessageMatcher("MSG1", prefix + ".1234")));
                    will(new CustomAction("release latch") {
                        @Override
                        public Object invoke(Invocation invocation) throws Throwable {
                            latch.unlatch();
                            return null;
            final Connection connection = createConnection(null, null);
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            connection.start();
            Topic wildcardTopic = (Topic) getInitialContext().lookup(prefix + "." + "#");
            Topic destination = (Topic) getInitialContext().lookup(prefix + ".1234");
            final MessageConsumer consumer = session.createConsumer(wildcardTopic);
            consumer.setMessageListener(messageListener);
            MessageProducer producer = session.createProducer(null);
            producer.send(destination, session.createTextMessage("MSG1"));
            latch.await(5000);
            connection.close();
            Thread.sleep(5);
            context.assertIsSatisfied();

    Check where your MDB sends the [response] messages to.

Maybe you are looking for

  • Components are not visible in personalization

    Hi, In iSupplier Portal, some page components are not visible for buyer address book. (Stack Layout: addressCreateUpdateStack) I even tried to change context, they are still not visible. How I can solve this issue? Btw, the personalizations are just

  • Start an executable from ODI when a record is inserted

    Hi All, I'm new with ODI and I have a problem. Is it possible that ODI to "feel" when a record is inserted in a mapped Oracle table and start a program? Could I use shell scripts for this? Thanks in advance, Teodora

  • Protected wma

    Our library has a service that allows people to download audiobooks for about 2 weeks (it's the online equivalent to checking out paper books). However, the format is protected WMA -- no other options are available. It turns out that iTunes can't imp

  • Luminosity issue when changing colors

    I want to change the color of a building when I use the color change brush the color looks really washed out IE dark red looking pink. It will correct to the right color if I first use the color brush set on luminosity and then use it set to color bu

  • Creative Entertainment Center in windows 7.the remote not working

    how i can activate the remote from x-fi fatality champion series.after i change my system form vista to 7 my remote not working.can i install the software from vista?