InetAddress.isReachable() only returns true

Hello,
Im trying to use the InetAddress.isReachable() method to get the host reacheability, but it only returns true to all addresses, being available or not...... in sniffer all appear to be ok, i can see the icmp packets incoming and outgoing....
Somene could help me? :D
thanks...

jverd, because the network address that im using in
this test is not being used in my network, i can see
it using ping tool from my desktop, and because the
sniffer shows me that the ping is requested, but does
not get response... ok?Okay, so this is a local address? Like a 192.168, or a 10. or 172.whatever? And you're certain there's no computer that has that address?
Just because ping fails doesn't mean nothing's there. A host might be there and not answering ping. isReachable also tries a TCP connection on port 7.
Try telnet the_supposedly_bad_address 7 and see if it responds. If so, then there's a host at that address, and isReachable is correct. If it doesn't, then it would seem to be a bug in isReachable (though I'm still not totally sure).

Similar Messages

  • Only returns true

    Hi all,
    associated with a button is the following cod eon HTML page:
    onClick="if(validateAddress(this.form)) displayResult(this.form);"
    In validateAddress Is this code:
    return=false;
    In displayResult is:
         var outTable;
         var validateAddressretVal=validateAddress(form);
         if(validateAddressretVal){
              outTable="<p>TRUE</p>"
         else{
              outTable="<p>FALSE</p>"     
         document.writeln(outTable)     
         document.close()
    with return set to false nothing happens. With return set to true the HTML page displays true. How do I correct this and how do I get the rest of the page to display with the result.
    TIA
    Mat

    where is the java in your question ?

  • InetAddress.isReachable returns a false reading

    I am creating a program to ping based on a bacth file of PC host names. It works great except for a few instances. In these instances, isReachable will return true, but when I try to manually ping the hosts it times out.
    I think that the issue may be related to cached entries in the DNS server, but I am not certain. The reason I think this is because when I ping the odd instances from command, it shows the IP address. This is not the case with the others. Could this be giving off a false reading? Though, when I use the IP address itself in the Java program (rather than the host name), I still get a false reading - in this case, it would not even be using the DNS server, correct? I thought that isReachable waited for an echo reply?
    Is there any other way I can go about this program, or any workaround for this issue?

    Do you have several threads invoking isReachable around the same time? If so, then perhaps this is the issue:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6595834

  • IsSiteLocalAddress() of inetAddress class returns true for IPv4 Adresses

    Any idea why isSiteLocalAddress() method of inetAddress class returns true for IPv4 Adresses?
    To my knowledge the IPv4 address can't be a site local address.
    Is it expected behaviour?
    Here is the snippet of the code.
    InetAddress inet=InetAddress.getByName(samplehost);
    // Verifying the address type of IPv6.
    if(inet.isAnyLocalAddress())
    System.out.println("Any local address is " + inet);
    if(inet.isLinkLocalAddress())
    System.out.println("Link local address is " + inet);
    if(inet.isLoopbackAddress() && ip.indexOf(":") != -1)
    System.out.println("Loopback address " + inet);
    if(inet.isMulticastAddress())
    System.out.println("Multicast address " + inet);
    if(inet.isSiteLocalAddress())
    System.out.println("Site local Address " + inet);
    if(ip.indexOf(":") != -1)
    System.out.println("Its an IPv6 global address " + inet);
    if(ip.indexOf(".") != -1 && ip.indexOf(":") == -1)
    System.out.println("Its an IPv4 global address " + inet);

    Here is the output and program for your reference.
    D:\DIA>java testIPv6 shash10-w2k3
    Host name is shash10-w2k3
    Inet Address Object is : shash10-w2k3/192.168.126.1
    Site local Address shash10-w2k3/192.168.126.1
    Its an IPv4 global address shash10-w2k3/192.168.126.1
    Here is the program.
    import java.util.*;
    import java.io.*;
    import java.util.*;
    import java.util.logging.Level;
    import java.rmi.*;
    import java.net.InetAddress;
    import java.net.Socket;
    import com.ca.dia.dna.*;
    import com.ca.dia.common.rmiClient.*;
    public class testIPv6 {
         public static void main(String args[])
              try{
                   System.out.println("Host name is "+args[0]);
                   InetAddress inet=InetAddress.getByName(args[0]);
                   System.out.println("Inet Address Object is : "+inet.toString());
                   String ip = inet.getHostAddress();
                   // Verifying the address type of IPv6.
              if(inet.isAnyLocalAddress())
                   System.out.println("Any local address is " + inet);
              if(inet.isLinkLocalAddress())
                   System.out.println("Link local address is " + inet);
              if(inet.isLoopbackAddress() && ip.indexOf(":") != -1)
                   System.out.println("Loopback address " + inet);
              if(inet.isMulticastAddress())
                   System.out.println("Multicast address " + inet);
              if(inet.isSiteLocalAddress())
                   System.out.println("Site local Address " + inet);
              if(ip.indexOf(":") != -1)
                   System.out.println("Its an IPv6 global address " + inet);
              if(ip.indexOf(".") != -1 && ip.indexOf(":") == -1)
                   System.out.println("Its an IPv4 global address " + inet);
              catch(Exception e)
                   System.out.println("Exception Happened");
                   System.out.println("Not reachable");
    }

  • InetAddress.isReachable() is acting strange

    I have three machines. One server running Linux, one PC inside our firewall running XP and one PC outside our firewall running XP. The PC outside our network is connected through a VPN to our network.
    I have a little java application running on both XP machines that check to see if the Linux box is reachable.
    import java.io.*;
    import java.net.*;
    public class Reachable
      public static void main(String args[])
        while (true)
          try
            InetAddress address = InetAddress.getByName("tux.xyz.com");
            System.out.println("Name: " + address.getHostName());
            System.out.println("Addr: " + address.getHostAddress());
            System.out.println("Reach: " + address.isReachable(3000));
          catch (UnknownHostException e)
            System.err.println("Unable to lookup tux.xyz.com");
          catch (IOException e)
            System.err.println("Unable to reach tux.xyz.com");
          try
            Thread.sleep(1000);
          catch (Exception e)
    }The XP box that inside the firewall says that the Linux box IS reachable, but the XP box that is outside the firewall says that the Linux box IS NOT reachable.
    We have checked our firewall and both XP boxes are getting through on port 7. The Linux box is getting the requests on port 7 also as I can see them using Ethereal.
    Any ideas why InetAddress.isReachable() would be returning FALSE?
    FYI, if I turn on the echo server on Linux, which uses port 7, the XP machine outside the firewall NOW says that the server is reachable...
    Much thanks.
    -Jeff

    Yeah, did notice that reply, but what is weird is that I am not getting a connection refused. I am not getting anything...
    The Linux server is visible from both the inside XP machine and outside XP machine via ping. What I thought was weird was that the inside XP machine was able to get to the Linux box, but the only way the outside machine was able to get to the Linux box was when I turned on the Echo service on port 7. That is what is weird. So turning on the Echo service made sense, but did not at the same time...

  • Nodediscovering via InetAddress.isReachable

    Hi,
    I'have to test if an host is reacheable, so I'm using InetAddress.isReachable(int timeout) method in j2se5.
    I've started using it in an application built on win enviroment and it seems works properly, now I'm trying it in a linux environment a I've some problems to reach nodes (I thinks it's related to firewall or similar network problems).
    Method description says:
    +"...A typical implementation will use ICMP ECHO REQUESTs if the privilege can be obtained, otherwise it will try to establish a TCP connection on port 7 (Echo) of the destination host.."+
    what exactly means?
    thank in advance

    This isn't really a JMX question, and you might want to ask it on a networking forum. But here's my take.
    ICMP ECHO REQUEST is what the ping command uses. If the ping command does the right thing in your environment, then InetAddress.isReachable should too.
    As you probably know, TCP/IP has port numbers, some of which have a standard use, like port 80 for HTTP. Port 7 is reserved for the Echo service, which just sends back everything it receives. You can typically tell whether the host "blibby" is running this service with the command "telnet blibby 7". But many machines do not have this service enabled.
    If you are on host blobby and neither of the above works against host blibby, then InetAddress.isReachable won't work either. More generally, if InetAddress.isReachable returns true then the host is reachable, but if it returns false then you can't really know whether the host is reachable. Where possible, a better approach is to try doing whatever you would want to do with the host and see if it works. For example, if you're going to need to do an HTTP request, just try to connect to port 80 and see if it works. You might want to use a technique similar to what I describe at http://weblogs.java.net/blog/emcmanus/archive/2007/05/making_a_jmx_co_1.html
    Regards,
    Eamonn McManus -- JMX Spec Lead -- http://weblogs.java.net/blog/emcmanus

  • Exchange 2007 SP2: HasActiveSyncDevicePartnership Always Returns True

    I am currently work with a customer in an Exchange Server 2007 SP2 environment. A Powershell script that is used for gathering mobile device information begins with at the mailbox level and filters with
    HasActiveSyncDevicePartnership equal to true, as in -
    Get-casmailbox -Filter {HasActivesyncDevicePartnership -eq $true }
    We have discovered that it appears as though this flag is set to true for every mailbox account, despite the fact that only a few mailboxes have actual EAS partnerships with devices.
    My understanding was that this flag should only ever return true if there is an actual ActiveSync partnership. Is there something I am missing here? Can the flag be true even if there is no (or has never been) a partnership?
    Don Sorcinelli - Microsoft MVP, Mobile Devices

    Hi,
    Yes, the value of the " HasActiveSyncDevicePartnership " will be set to true if there is an actual ActiveSync partnership. Also you can use the following command to
    check the detail sync information such as device name,  last sync time:
    Get-ActivesyncDeviceStatistics -Mailbox [email protected]
    If no statistics information returns, The most probable cause 
    should be that someone set the HasActiveSyncDevicePartnership to true for all mailbox users accidently. Please run the following command to change them back:
    get-casmailbox |set-casmailbox -HasActivesyncDevicePartnership $false
    Then set the
    HasActiveSyncDevicePartnership to true for the users who have an actual ActiveSync partnership:
    Set-casmailbox –identity
    [email protected] -HasActivesyncDevicePartnership $true
    Gen Lin
    TechNet Subscriber Support
    in forum
    If you have any feedback on our support, please contact
    [email protected]
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Thanks
    Gen Lin-MSFT

  • Boolean User Properties always returns TRUE

    Hi, I am trying to get some propeties from the user on the AD and I found out with the following issue, all the boolean attributes always return TRUE as value. The Code that I am using to extract them is the following
    foreach ($objUser in $objUsers)
     $bolPasswordNeverExpires = [boolean] $objUser.Properties['PasswordNeverExpires'];
     $bolEnabled = [boolean] $objUser.Properties['Enabled'];
     $bolAccountExpired = [boolean] $objUser.Properties['AccountExpired'];
    Could you please guide me into the proper direction to solve it. I looked up in most of powershell related topic and did not find a way to solve it. I even attempt using UserAccountControl Attribute to check Enabled status do not matter agains which value
    I check it, it always returns TRUE.

    Thank´s for the tip. Unluckily when I attempt it, if I left only
    $objUsers.PasswordNeverExpires or $objUsers.Enabled, it only return whites spaces and no comparison from True or False is feasible.
    If I change it to [boolean] $objUsers.PasswordNeverExpires or $objUsers.Enabled instead of using the Properties option, it returns False for all values.
    I attempt to use the UserAccountControl field for look up the property Ex: (objUser.UserAccountControl AND 2) for Enabled and it also returns True for all situation
    I look up for the properties on the ISE interface and the only ones displayed are the following ones:
    distinguishedname
    displayname
    whencreated
    samaccountname
    sn
    accountexpires
    pwdlastset
    samaccounttype
    adspath
    useraccountcontrol
    whenchanged
    cn
    userprincipalname
    lastlogontimestamp
    msds-user-account-control-computed
    May it be an issue with the filter that does not load the specified properties?

  • 11g HS ODBC database link only returning one column

    Hi,
    We having a problem with a HS ODBC database link to a SQLServer database - only one column is being returned (when we do a simple 'select * from remote_table@SQLServer_dblink'). We recently set up another HS database link to a MySQL database and that's works okay, even though the init*.ora files have the same settings configured.
    Any ideas what might cause this?
    This is the trace file:
    Oracle Corporation --- FRIDAY OCT 28 2011 14:26:33.827
    Heterogeneous Agent Release
    11.2.0.2.0
    Oracle Corporation --- FRIDAY OCT 28 2011 14:26:33.827
    Version 11.2.0.2.0
    HOSGIP for "HS_FDS_TRACE_LEVEL" returned "ON"
    HOSGIP for "HS_FDS_SHAREABLE_NAME" returned "/usr/lib/libodbc.so"
    HOSGIP for "HS_OPEN_CURSORS" returned "50"
    HOSGIP for "HS_FDS_FETCH_ROWS" returned "100"
    HOSGIP for "HS_LONG_PIECE_TRANSFER_SIZE" returned "65536"
    HOSGIP for "HS_NLS_NUMERIC_CHARACTER" returned ".,"
    HOSGIP for "HS_KEEP_REMOTE_COLUMN_SIZE" returned "OFF"
    HOSGIP for "HS_FDS_DELAYED_OPEN" returned "TRUE"
    HOSGIP for "HS_FDS_WORKAROUNDS" returned "0"
    HOSGIP for "HS_FDS_MBCS_TO_GRAPHIC" returned "FALSE"
    HOSGIP for "HS_FDS_GRAPHIC_TO_MBCS" returned "FALSE"
    HOSGIP for "HS_FDS_RECOVERY_ACCOUNT" returned "RECOVER"
    HOSGIP for "HS_FDS_TRANSACTION_LOG" returned "HS_TRANSACTION_LOG"
    HOSGIP for "HS_FDS_TIMESTAMP_MAPPING" returned "DATE"
    HOSGIP for "HS_FDS_DATE_MAPPING" returned "DATE"
    HOSGIP for "HS_FDS_MAP_NCHAR" returned "TRUE"
    HOSGIP for "HS_FDS_RESULTSET_SUPPORT" returned "FALSE"
    HOSGIP for "HS_FDS_RSET_RETURN_ROWCOUNT" returned "FALSE"
    HOSGIP for "HS_FDS_PROC_IS_FUNC" returned "FALSE"
    HOSGIP for "HS_FDS_REPORT_REAL_AS_DOUBLE" returned "FALSE"
    using MySQL_CSSUser as default value for "HS_FDS_DEFAULT_OWNER"
    HOSGIP for "HS_SQL_HANDLE_STMT_REUSE" returned "FALSE"
    hgocont, line 2754: calling SqlDriverConnect got sqlstate I

    The characterset on our Oracle DB is AL16UTF16, but we have already tried several language settings without success (see commented out sections in the *.ora file below) - but interestingly not a UTF16. Is that the problem, do you think?
    The collation on the SQLServer DB is 'SQL_Latin1_General_CP1_CI_AS', if that makes any difference. The db server is Linux (5.6), Oracle db is 11.0.2.0 and the SQLServer db is v.8.
    We don't get an error when using the dblink...it's just that only the last column is returned. If we explicitly select any other columns, we get the 'invalid identifier' error. It's the same with whatever table we dblink to...the columns are just standard chars and numerics, nothing large or custom, etc.
    I'll try and dig up the full trace file....
    HS_FDS_CONNECT_INFO=CSS_ST
    set ODBCINI=/etc/odbc.ini
    HS_FDS_TRACE_LEVEL = DEBUG
    HS_FDS_SHAREABLE_NAME = /usr/lib/libodbc.so
    HS_FDS_SQLLEN_INTERPRETATION=32
    #HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P1
    #HS_LANGUAGE=AMERICAN_AMERICA.WE8MSWIN1252
    #HS_LANGUAGE=AMERICAN_AMERICA.UTF8
    set ODBCINSTINI=/etc/odbcinst.ini
    set LD_LIBRARY_PATH=/usr/local/easysoft/lib:/usr/local/easysoft/sqlserver/lib:/usr/lib:/u01/app/oracle/product/11.2.0/dbhome_1/lib
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------

  • API search will only return the first 200 results????

    It seems that I can only retrieve 200 results when using doOracleSimpleSearch api call.
        osr = oses.doOracleSimpleSearch(strSearch, 1, 1000, false, false, true);
        nCount = osr.docsReturned;
        nCount2 = osr.resultElements.Length;
        nCount3 = osr.estimatedHitCount;nCount and nCount2 are both 200.
    nCount3 is 1332
    Ok, no problem. Even though I asked for 1000 results, I figure it will only return 200 at a time, so I write a simple loop.
       while (nTotalResults < nCount3)
          osr = oses.doOracleSimpleSearch(strSearch, nTotalResults + 1, 200, false, false, true);
          nCount = osr.docsReturned;
          nTotalResults += nCount;
       }After executing the search the first time, nTotalResults is set to 200, so I'm now requesting that the search starts at index 201 and to return the next block of 200.
    osr.docsReturned is now = 0
    stuck in infinite loop because it's not returning all my results.
    Update:
    It seems this is not just an API issue. If I do the search through the web interface, and go to page 20 (it's displaying 10 results per page) I see results. But as soon as I go to page 21, the page is blank even though it says there are over 1000 results.
    Edited by: JimG on Feb 15, 2012 5:17 PM

    You need to change the "Maximum Number of Results" from the Admin GUI.
    Go to Global Settings -> Query Configuration, and you'll find it there.

  • Executing VO only returns 1 record

    Hi,
    I am using Jdev 11.1.1.4.0.
    I have a Read only VO and have a methond in AMImpl class that reads
    ViewObjectImpl componentLOV;
    componentLOV= getComponentsNameOnly();
    componentLOV.setNamedWhereClauseParam("bndComponentName", componentName);
    componentLOV.executeQuery();
    return componentLOV.getAllRowsInRange();This only returns 1 record althought there are more than 1 record.
    If I change the code to componentLOV = getUpdatableVO();, then it returns all the records that meets the condition.
    Any idea?
    Thanks
    Bones Jones
    Edited by: Bones Jones on Jul 13, 2011 10:53 AM
    Edited by: Bones Jones on Jul 13, 2011 10:54 AM

    plz paste the complete method. You need List if you want to work with multiple rows
    here what i copied from the docs
    public class AppModuleImpl extends ApplicationModuleImpl
    public List<ViewRowImpl> findProducts(String location)
    List<ViewRowImpl> result = new ArrayList<ViewRowImpl>();
    ViewObjectImpl vo = getProductsView1();
    vo.setNamedWhereClauseParam("TheLocation", location);
    vo.setForwardOnly(true);
    vo.executeQuery();
    while (vo.hasNext()) {
    result.add((ViewRowImpl)vo.next());
    return result;
    }

  • HasEventListener and willTrigger always return true

    Hi  everybody.
    I'm trying to achieve the following result.
    I'm listing all items in a form.
    When I encounter a button I check if it has already an event listener applied to it. If not , I apply the event Listener with addEventListener.
    In this way, the next time I'll list the whole form I won't apply the event listener another time (if for example I apply the same event listener twice to a button which insert a new record in a database as result I'll have 2 records added also if the user clicked once...no good at all!!!)
    To accomplish this task I'm using the Actionscript function hasEventListener(EventType) and here comes the weird thing.
    Eveytime I invoke hasEventListener on the form's button it always returns true event if is the first time a list the form (so no event listener applied yet) , even if before to invoke hasEventListener I run removeEventListener.
    I've got the same behavior when i use willTrigger() function, it always returns true no matter when i call it.
    One possible solution could be set a global boolean property to store if Ialready listed the form and applied the event listener to it, but it would be better using hasEventListener, because I've got a class that perform this form listing , and this class is used on wide project, so if I get to fix this problem inside the class I would fix the problem in the entire project in on shot (I love oop programming!!!!)
    Has anybody already addressed this problem?
    Any advisement would be really appreciated.
    Thanks in advance for the attention.
    Best regards!!
    Luke

    Hi, flex harUI.
    Thanks very much for your reply.
    I knew that if I apply an event listener twice it should fire up only once, but this isn't what happen.
    Here's my scenario:
    -  I've got a component with the form inside it
    - Through a menu a go to the state the component is in and I call an "init" function inside the component
    - In the init function I call the Class which activate the form by applying eventlistener on the button
    - The user can navigate away from the component by click another menu item and then return to the component invoking again the form activation (and so let my application apply once again the addEventListener)
    - Here's what happen: the second,third,... time the user return to the component, when he try - for example - to add a record, the record is added two,three... times according to how many times the users "reinitialized" the component. The same things happen when the user tries to delete a record, he is prompted two,three,.... times if he's sure to delete it.....
    It's a really strange behaviour.
    I've found i worked around, by setting a global bool var "initialized" and before call the form activation i check the value of this var, but It's not a very beautiful solution, 'cause I would prefer to fix this problem inside the class, so the fix the problem in the whole project just in one shot!!! (that's why I would like to use hasEventListener() to check if the button has already an eventListener)
    Thaks anyway for the reply!
    If I've some news I'll update ya.
    Bye!

  • CI - Powershell Boolean Rule Always Returns True

    I'm trying to create a configuration baseline / item for a particular piece of software using a powershell script of data type Boolean. However, I'm having the issue that the evaluation is always returning compliant whether the workstation is or not. The
    script is as follows:
    $ErrorActionPreference = "SilentlyContinue"
    $Condition1 = (Test-Path -LiteralPath 'HKLM:\SOFTWARE\Adobe\Premiere Pro')
    $Condition2 = (Test-Path -LiteralPath 'C:\Program Files\Adobe\Adobe Premiere Pro CS6\Presets\Textures\720_govt1_bar.png')
    if ($Condition1) {
    if ($Condition2) {echo $true}
    else {echo $false}
    else {echo $true}
    This script works perfectly fine when run locally and always returns $true or $false as expected. However it only ever returns Compliant when used in a CI. It doesn't matter what the state of the 2 conditions are, it always evaluates Compliant.
    Any ideas?

    I'm beginning to wonder if there is variation between how well this feature works on Windows 7 and Windows 8.1. I'm beginning to notice that it usually works well on 7 but I have constant hell with it on 8. The last thing I tried which seemed to work (assuming
    it was not just randomness) was accepting the default "Platform" settings of the CI/CB. Before I had chosen Windows 7 and 8.1 only and was never able to return any value except Compliant on 8. Accepting the all platforms default Finally
    allowed me to show a state of Non-Compliant on 8. This was using a powershell script of string data type as discussed previously.
    My latest torment is discovering how to force a true re-evaluation of an updated CI/CB. In my non-compliant Win8 example, I have added a remediation script to an existing Monitor-Only CI and configured it to remediate. In my Win 7 members of the collection,
    everything works successfully, the condition is remediated and the state reports Compliant but on the Win8, although the local Control Panel applet shows both the CB and CI to have new revisions and the evaluation shows it has run with a new date/time,
    the remediation script never runs and changes to Compliant.
    Any suggestions how I can force an updated CI/CB to really re-evaluate, not just report it has?

  • JTable Won't Allow Editing Despite isCellUpdatable is Set to Return True

    Mass apologies if I somehow sent this to the wrong forum by mistake. However, aid from the local Java gurus would be much appreciated since I'm the only Java programmer at this company, so I don't have anyone to really ask for advice or anything.
    I've been trying to enter an updatable ResultSet into a JTable for about a week now, but the issue I ended up running into was that if you click on a cell with the intention to edit the contents, it won't even highlight the cell, much less let you edit it.
    I've searched Google and this forum along with tried to hunt down more complex books on Java rather than your standard "So you want to learn Java" cookbooks, but I've come up with null. I've also created about five different variations of TableModels for the purposes of handling this, including one that used an array of Objects instead of the ResultSet, but the problem persists.
    Here is the latest version of the TableModel that I've come up with
    package EventCalGUI;
    import javax.swing.table.AbstractTableModel;
    import EventCalSQL.TableData;
    @SuppressWarnings("serial")
    public class UpdateRSModel extends AbstractTableModel
         /** <code>TableData</code> from database */
         private TableData data;
         public UpdateRSModel(TableData tdata)
              data = tdata;
         @Override
         public int getColumnCount()
              return data.getColCount();
         @Override
         public int getRowCount()
              return data.getRowCount();
         @Override
         public Object getValueAt(int row, int col)
              return data.getValue(row, col);
         @Override
         public boolean isCellEditable(int row, int col)
              return true;
         @SuppressWarnings("unchecked")
         @Override
         public Class getColumnClass(int col)
              return data.getColClass(col);
         @Override
         public String getColumnName(int col)
              return data.getHeader(col);
         @Override
         public void setValueAt(Object value, int row, int col)
              data.setValue(value, row, col);
    }The reason for suppressing the warnings is because Eclipse attempts to be too helpful with its cautions and I was sick of seeing a long list of unnecessary yellow caution signs.
    This is the TableData class that the above TableModel derives from. I hadn't added in the actual ResultSet updating capabilities until I was sure I could get the JTable to work.
    package EventCalSQL;
    import java.sql.*;
    public class TableData
         Object[][] data = null;
         String[] headers = null;
         int rows = 0;
         int cols = 0;
         @SuppressWarnings("unchecked")
         Class[] colclass = null;
         public TableData (ResultSet rs)
              try
                   ResultSetMetaData metadata = rs.getMetaData();
                   // -------------- SET COLUMN DATA ---------------
                   cols = metadata.getColumnCount();
                   headers = new String[cols];
                   colclass = new Class[cols];
                   String classname = "";
                   for (int b = 0; b < cols; b++)
                        headers[b] = metadata.getColumnName(b + 1);
                        classname = metadata.getColumnClassName(b + 1);
                        colclass[b] = Class.forName(classname);
                   // ------------ SET ROW DATA --------------
                   if (rs.last())
                        rows = rs.getRow();
                        rs.beforeFirst();
                   if (rows != 0)
                        data = new Object[rows][cols];
                        for (int i = 0; i < rows; i++)
                             rs.absolute(i + 1);
                             for (int a = 0; a < cols; a++)
                                  data[i][a] = rs.getObject(a + 1);
              catch (SQLException sql)
                   // I'M UNINTERESTING!
              catch (ClassNotFoundException cnf)
                   // BE BORED!
              catch (NullPointerException np)
                   // I'M BORING!
         public Object getValue(int row, int col)
              return data[row][col];
         public String getHeader(int col)
              return headers[col];
         public void setValue(Object value, int row, int col)
              data[row][col] = value;
         public int getRowCount()
              return rows;
         public int getColCount()
              return cols;
         @SuppressWarnings("unchecked")
         public Class getColClass(int col)
              return colclass[col];
    }I've checked the exceptions, and they work. I just added into the comments since nothing's really supposed to happen there if it's an empty set. I just have a weird sense of humor after twenty-plus hours of coding variations of the same thing over and over.
    Thank you very much for any and all help ahead of time!

    Hidralisk: Thank you for the suggestion, but that's not the problem I'm running into. I really appreciate you trying to help though.
    camickr: I'll double-check my code to see where I might've unintentionally strayed from your suggestion. I deeply appreciate the help.
    Edited by: wsizemore on Dec 6, 2007 6:51 AM
    Haven't had the time to double-check my code since I've been re-assigned to other projects (the joys of being the solo Java programmer here), but I awarded you the points, camickr, since your suggestion seems to be the one that could've put me on the right track. Thanks so much for your help.

  • Return what ? IS IF UPDATE (Column_name) parameter in a trigger definition will return TRUE ?

    The IF UPDATE (Column_name) parameter in a trigger definition will return TRUE in case of an INSERT statement being executed on the triggered table: 
    Which option is correct ?
    a. YES
    b. NO
    c. It returns TRUE only if an UPDATE query is executed
    d. Both b and c

    See MSDN: UPDATE() (Transact-SQL)
    "Returns a Boolean value that indicates whether an INSERT or UPDATE
    attempt was made on a specified column .."
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

Maybe you are looking for