GetHardwareAddress() and JSP.  Plz help

I'm writing a JSP page that must get The MAC Address of the client.
I used the following code:
InetAddress addresses = InetAddress.getByName("192.168.1.100");
NetworkInterface ni = NetworkInterface.getByInetAddress(addresses);
byte[] mac = ni.getHardwareAddress();
if (mac != null) {
for (int i = 0; i < mac.length; i++)
outz.write(mac);
outz.write puts the result in an HTML page
the result i got was: !k&?" instead of the typical xx-xx-xx-xx-xx
I figured out that maybe the result isnt being written in hex so I added:
{code}{code}
InetAddress addresses = InetAddress.getByName("192.168.1.100");
NetworkInterface ni = NetworkInterface.getByInetAddress(addresses);
byte[] mac = ni.getHardwareAddress();
if (mac != null) {
for (int i = 0; i < mac.length; i++)
outz.write("%02X%s", mac[i], (i < mac.length - 1) ? "-" : "");
the error I got was:
An error occurred at line: 19 in the jsp file: /jsp/savename.jsp
The method format(String, byte, String) is undefined for the type FileWriter
16: byte[] mac = ni.getHardwareAddress();
17: if (mac != null) {
18: for (int i = 0; i < mac.length; i++) {
19: outz.write("%02X%s", mac[i], (i < mac.length - 1) ? "-" : "");
20: }
21: }
22:
VERY IMPORTANT NOTE: this code works in normal java file, but in JSP it makes this error.
Plz can anyone help me figure what's the error? and how to solve it?
can anyone provide a working way for this, using these methods? and thx very much.

look bidox this is the query
String sql= "SELECT * FROM WOH.P_DEMGRAPHICS " +
"WHERE P_ID LIKE \'%" + query+ "%\'";
and P_DEMGRAPHICS is tabel inside my WOH database
and am searching using the Primary key
i uploaded screen shot to understand
http://rapidshare.com/files/102091314/tabel.JPG.html
i want to retrive raws using P_ID ie input P1 and it will return the rows
Now it should work! what you doing wrong is the database just use the table ignoring the WOH; the reason is, if you logged in the workspace using your username and password, automatically oracle will recordnise the table with that user login assigned.
Your code now looks like this;
String sql= "SELECT * FROM P_DEMGRAPHICS " +
"WHERE P_ID LIKE \'%" + query+ "%\'";

Similar Messages

  • Sir i have iphone 4s i brought second hand and i dont no icloud id and password plz help me

    sir, i have apple iphone 4s i brought second hand and i dont no icloud id and password plz help me.
    <Personal Information Edited by Host>

    It's a bad idea to post your IMEI number and I've asked the Hosts to remove it.
    If the phone had been locked by the previous owner only he can unlock it, either by providing you with the passcode or by removing it from his list of devices.
    If you are unable to contact the previous owner and get him to do this then I'm afraid your phone cannot be unlocked and is useless; there is no way round this.

  • Did all the resets and still wifi connects and disconnects , plz help

    did all the resets and still wifi connects and disconnects , plz help

    I upgraded Apple TV late last week. Last weekend I rented a couple of movies from Apple TV. I watched one immediately, and was going to watch the other one the next day. On Sunday I opened up Apple TV to watch the film, and..... NOTHING THERE. I could see 'purchased movies', 'top movies', etc., at the top of the bar, but no mention of rentals. Even the film I'd watched (which obviously you can see for 48 hours) had disappeared into a black hole in Apple TV. I have been charged for these movie, and sent in a complaint.
    My airplay seemed to be fine, but.... last night, my computer was not seeing an Apple TV or showing an airplay sing, so I restarted and the Apple TV and airplay sign returned. If I chose to watch the film on the computer it started up immediately, if I chose airplay, I got the first image of the film and the loading sign going on and on (round and round) forever. The film never started. I restarted my Apple TV, the same. I restarted the computer, the same. I tried with various programmes and no go.
    iMore has the following suggestion. I am not sure if this will help. It sounds a PIA, but if I can't get airplay to work, I might try it: http://www.imore.com/how-restore-2nd-or-3rd-generation-apple-tv-back-factory-set tings-itunes

  • Hello  I upgraed my iphone to ios 7 but its dosent work like app stor dosent install any brogram or update programs and its slow and stuck plz help me

    Hello
    I upgraed my iphone to ios 7 but its dosent work like app stor dosent install any brogram or update programs and its slow and stuck plz help me

    My iPhone 5 wouldn't start after I turned it off a few minutes after writing this. It went into recovery mode and I had no choice but to connect to iTunes on PC and restore.
    I restored to factory setting first, just to validate my phone was okay. For a second consecutive iOS update, the  iPhone 5 did not update smoothly while connected to PC and iTunes - I had to retry two times before the progress bar for the update showed. (The exact same problem with the restart occured when I updated to 7.0.4.)
    The good news is that I was ultimately able to restore the iPhone 5 to factory settings while running iOS 7.0.6. I did have a backup from about a month ago lying around and was able to successfully restore with that as well, so the damage done is almost negligible since I had my contacts, notes, mail, etc. backed up to iCloud.
    Once I completed both restores, the sync with iTunes worked fine.

  • Tabs in JSP- Plz help-Urgent

    I want to have 3 tabs say Tab1, tab2, tab3 in my page and based on which tab is clicked , I have to display the contents of a table.
    Ex: if Tab1 is clicked, i have to display contents of Table1 and tab2,table2 and so ...
    Plz help with how to link the click on the tab to calling of the JSP file which retrives and displays the data???....
    Its urgent ;plz help

    dnamiot ,
    I'm also looking for similar funcitonality.
    the URL mentioned in your reply is not free ware. you know, it is tough to convince management to buy a software for the project even it is $1.
    So if you know any taglibrary which is free ware , which generates maximum of 4 tabs and dynamic in nature, please let me know.
    Thanks in advance
    tekbond

  • Error while trying to synchronize Audio and MIDI. plz help i cant hear anything

    plz help me i cant hear nothing and its says: Error while trying to synchronize Audio and MIDI.
    Sample Rate 38536 recognized.
    Check conflict between Logic Pro X and external device. ????????   PLZ HELP

    It means you are overtaxing the CPU, likely with just one (3rd party-)software instrument plugin. Ignore the word "external", in this context it often means "3rd party plugin".
    So what synth is it? Since you're Dutch, it's probably one of the trancy dancy synths, such as Albino, Diva, Sylenth or Massive... I could be wrong though...
    The best way to avoid this message is to Freeze the track with the guilty synner - however, a frozen track cannot be edited, so if that is a problem, you will have to make the synth itself run lighter, which can be achieved by turning of internal effects that are ON the synth itself, especially reverb.
    http://help.apple.com/logicpro/mac/10/#lgcpf1cbfd51

  • We are unable to start your subscription  plz help me ladies and gentlemen PLZ HELP ME!!!

    i just need help because every time i type in my serial number it just says unable to start your subscription plz help me people

    -LogiKzzz we will not able to solve this issue for you in a public setting as we will require personal information to resolve the issue.  For the best assistance, I recommend our chat support at http://adobe.ly/rSZYR5.  Our chat representatives can provide a personalized experience to resolve the issue you have described.

  • Hiii . i have encountere a problem . my notes app are not syncing in my ipad and iphone . plz help

    hiii . i have encountere a problem . my notes app are not syncing in my ipad and iphone . plz help

    Hi marcmartineau,
    I'm not sure why this is happening, but I think I'm seeing the same thing. Many times when I get an email on the iPad or iPhone with a picture attached, I don't see the picture but instead just a placeholder icon.
    I have found a work around though to at least see the picture. If I forward it and include the attachment, I see the picture in the outgoing email. I can even save the image from the sending email if I really don't want to send it. If i do send it to myself, chances are I will see the picture in the email when I receive it even though it's just a resend of the original.
    weird.

  • Mysql and jsp PLZ PLZ PLZ HELP ME

    Hi >>>>>
    I want to as if there any problem with the fallowing code????
    ===========================================================
    DriverManager.registerDriver(driver);
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/ecom","ecomAdmin","ecomAdmin");
    state=conn.createStatement();
    ============================================================
    becoz this code isn`t work and givn`t any Exception er ERROR or any thing .
    so PLZ Tell me what to do ?????

    Since I am not using the same driver I cannot be sure of the problem.
    This is how I make a connection using the com.mysql.jdbc.Driver
    // Set SQL jdbc driver
    String connectionDriver = "com.mysql.jdbc.Driver";
    // Create connection string for local host
    String connectionString = "jdbc:mysql://localhost/passport?user=root&password=xxx";
    // Load database driver
    Class.forName(connectionDriver);
    // Make the actual connection
    Connection sqlCon = DriverManager.getConnection(connectionString);
    I hope this helps
    rykk

  • Class cast exception in jsp plz help

    i have written a jsp where i displayed a text box with value given by user inside it
    when the user enters some other value in text box and clicks on update button then i forwarded reqeust to servlet which will some data base work
    servlet will forward again to the same jsp with the new value in text box.
    but i am getting CLASS CAST EXCEPTION when servlet is forwarding reqeust to same JSP
    help me what to do ........
    thanking you in advance ..cheers

    display cart.jsp file:
    <%@ page import="java.util.*,org.*" %>
    <html>
    <body>
    <%
    Vector cartupdate = (Vector)session.getAttribute("cartlist");
    for (int i = 0; i < cartupdate.size(); i++) {
    CartListBean clb = (CartListBean)cartupdate.elementAt(i);
    %>
    <form name="itemslist<%=i%>" action="updateCart" method="post">
    <input type="hidden" name="itemcode" value="<%=clb.getItemCode()%>">
         <input type="hidden" name="itemname" value="<%= clb.getItemName()%>">
    <input type="hidden" name="price" value="<%= clb.getPrice()%>">
    <%= clb.getItemName() %>
    <input type="text" name="qty" value="<%=clb.getQuantity()%>">
    <input type="submit" name="<%=clb.getItemCode()%>" value="update">
    </form>
    <br>
    <%
    %>
    <form name="tobuy" action="buysrv" method="post">
    <input type="submit" name="buy" value="BUY">
    </form>
    </body>
    </html>
    updatecart servlet code:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import org.*;
    import java.sql.*;
    import java.util.*;
    public class UpdateCart extends HttpServlet
    public void service(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
    HttpSession session=request.getSession(false);
    Vector cartupdate = (Vector)session.getAttribute("cartlist");
    for (int i = 0; i < cartupdate.size(); i++) {
    org.CartListBean cart = (org.CartListBean)cartupdate.elementAt(i);
    if((cart.getItemCode()).equals(request.getParameter("itemcode")))
    org.CartListBean clb=new org.CartListBean();
    clb.setItemCode(request.getParameter("itemcode"));
         clb.setQuantity(request.getParameter("qty"));
         clb.setItemName(request.getParameter("itemname"));
    clb.setPrice(request.getParameter("price"));
    cartupdate.setElementAt(clb,i);
    session.setAttribute("cartlist",cart);
    ServletContext application=getServletContext();
    System.out.println("got finished");
              RequestDispatcher rd=application.getRequestDispatcher("/displaycart.jsp");
                   rd.forward(request,response);
    Message was edited by:
    143java

  • About XML/XSL and Javascript : Plz Help Urgent

    Hai , I am developing one module which invloves XML database ,XSL and Javascript.
    In this I want to transform XML data to XHTML form using XSLT .,
    I have done this ,(using xsl templates ,In my form two radio buttons one dropdown box and two text boxes are there .).
    All the information which ever is displayed coming from XML .,
    But I want to validate this elements (which are in xslt ,ie checking text box is empty or not ..)
    Where I have to add script in XSL .,
    Plz give simple example on this ,
    I am sending this code ,plz have a look at this ,,
    XML -----+ ---XSLT---------------> XHTML(HTML) (where validation is required)*
    Hotels.xml
    ==============>
    <Services>
         <Service>
              <Hotels type="radio" title="Hotel" groupname="service" default="true"/>
              <HotelsFlights type="radio" title="Flight+Hotel" groupname="service"/>
         </Service>
         <Hotels>
              <Destination title_d="Destination :">          
                   <DestinationPlace type="OPTION" id="" title_d="Select Destination" value_d="Select Destination" defalut="true"/>
                   <DestinationPlace type="OPTION" id="" title_d="Aruba" value_d="Aruba" />
              </Destination>
              <HotelChoice title_hc="Hotels :">
                   <choice type="OPTION" id=" " title_h="AmsterDam Manor Beach" value_h="AmsterDam Manor Beach"/>
                   <choice type="OPTION" id=" " title_h="Wyndham Aruba Beach" value_h="Wyndham Aruba Beach"/>
              </HotelChoice>
              <Dates>
                   <CheckIn type="INPUT" title_dt="Check In :" id="chkin" name="chkin" size_dt="10" maxlength="10">mm/dd/yyyy</CheckIn>
                   <CheckOut type="INPUT" title_dt="Check Out :" name="chkout" size_dt="10" maxlength="10">mm/dd/yyyy</CheckOut>
              </Dates>
              <RoomNos title="No.of Rooms :">
                   <room type="OPTION" id="" titl="1" valu="1"/>
                   <room type="OPTION" id="" titl="1" valu="2"/>
                   <room type="OPTION" id="" titl="1" valu="3"/>
              </RoomNos>
              <Submit tile="Search :" type="submit" id="search" value="Search"/>
         </Hotels>
    </Services>
    Hotels.xsl-
    ------------->
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html"/>
    <xsl:template match="/">
         <html>
         <head>
         <script language="javascript">
         function RadioFunc()
              var result;
              alert(" Radio ");
              result +=document.write("<TABLE >");
              result +=document.write("<TR><TD>"+'Praveen'+"</TD></TR>");
              result +=document.write("</TABLE>");
              alert("Result "+result);
         function validateForm()
              alert("Before validating");
              var chkindate= document.getElementById(chkin).value;
              alert(chkindate);
         </script>
         </head>
         </html>
         <xsl:apply-templates/>
    <xsl:if test="@value_d='Select Destination'">
                        alert("Please Enter Destination");
              </xsl:if>
    </xsl:template>
    <xsl:template match="Services" >
         <form name="myform" action="two.jsp" method="get" >
              <table bgcolor="lightgreen" width="350" height="200" border="1" >
              <tr><td><xsl:apply-templates/></td></tr>
              </table>
         </form>
    </xsl:template>
    <xsl:template match="Service">
         <table border="0" align="center" valign="top"><tr>
         <xsl:for-each select="*">
              <td align="left"><xsl:value-of select="@title"/></td>
              <td align="center">
              <input type="{@type}" onClick="RadioFunc()">
                   <xsl:attribute name="Name">
                        <xsl:value-of select="@groupname"/>
                   </xsl:attribute>
                   <xsl:attribute name="value">
                        <xsl:value-of select="@value"/>
                   </xsl:attribute>
                   <xsl:if test="@default='true'">
                        <xsl:attribute name="checked"/>
                   </xsl:if>
              </input>
              </td>
         </xsl:for-each>
         </tr></table>
    </xsl:template>
    <xsl:template match="Hotels/Destination">
    <xsl:value-of select="@title_d"/>
         <SELECT id="dest" name="dest">
         <xsl:for-each select="*">
              <xsl:element name="{@type}">
                   <xsl:value-of select="@value_d"/>
              </xsl:element>
         </xsl:for-each>     
         </SELECT>
    </xsl:template>
    <xsl:template match="Hotels/HotelChoice">
    <xsl:value-of select="@title_hc"/>
    <SELECT id="hcid" name="hcid">
         <xsl:for-each select="*">
              <xsl:element name="{@type}">
                   <xsl:value-of select="@value_h"/>
              </xsl:element>
         </xsl:for-each>
    </SELECT>
    </xsl:template>
    <xsl:template match="Hotels/Dates">
    <table><tr>
    <xsl:for-each select="*">
              <td>
                   <xsl:value-of select="@title_dt"/>
              </td>
              <td>
              <xsl:element name="{@type}" >
                   <xsl:attribute name="size">
                        <xsl:value-of select="@size_dt"/>
                   </xsl:attribute>
                   <xsl:attribute name="maxlength">
                        <xsl:value-of select="@maxlength"/>
                   </xsl:attribute>
                   <xsl:attribute name="value">
                        <xsl:value-of select="text()"/>
                   </xsl:attribute>
              </xsl:element>
              </td>
    </xsl:for-each>
    </tr></table>
    </xsl:template>
    <xsl:template match="Hotels/RoomNos">
    <table align="center"><th>Travellers</th>
    <tr><td><xsl:value-of select="@title"/></td>
    <td><SELECT id="rooms" name="rooms">
              <xsl:for-each select="*">
                   <xsl:element name="{@type}">
                        <xsl:value-of select="@valu"/>
                   </xsl:element>
              </xsl:for-each>     
    </SELECT>
    </td></tr>
         </table>
    </xsl:template>
    <xsl:template match="Hotels/Submit">
         <table align="center" border="0" >
         <tr>
         <td align="center">
              <input type="{@type}" onclick="validateForm();">
                   <xsl:attribute name="value">
                        <xsl:value-of select="@value"/>
                   </xsl:attribute>
              </input>
         </td>
         </tr>
         </table>
    </xsl:template>
    </xsl:stylesheet>
    ======================================================

    Hi
    This is not the forum for this type of question ...sorry. Try the XMLDB forum, XML DB
    Tim

  • Plot function and Interpolate Plz Help!!!!

    Im trying to obtain a plot from  the following function ( see attached file)  a I-V curve and then from the plot i wanna determine values for "I" when  values of V are specified. I wanna do this without using cursers but programmatically.(possibly using interpolate functions) .. I hope someone can help me..thanks a lot
    Attachments:
    eq.JPG ‏10 KB

    lil_zu wrote:
    ...is it possible to plot this function without solving?
    No! You cannot plot a function unless you can solve it (either analytically or numerically).
    Do you have an image of how it is supposed to look like?
    What are typical ranges for I and V?
    Do you have a link to a website that explains your application?
    LabVIEW Champion . Do more with less code and in less time .

  • I forget my iphone 5 passward and i cant remove the ownership passward and so plz help me this topic coz what can i do?

    i forget my iphone 5 passward and i can't rem ove it because i update the software and when my phone finally done then asking the ownership passward so i forget it.  so what can i do i solved this probleum.  thanks
    i buy this phone in my friend so my friend is not here so i will be waiting your cute answers
    thank's

    Hi bilalusman,
    If you are having issues with the password on your iPhone, you may find the following article helpful:
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    Regards,
    - Brenden

  • When I use VPN on iPad 2 ,it disconnects alot and frequently,plz help me

    Hi friends,when I use VPN on my new iPad 2 ,the VPN disconnects a lot and frequently in short periods,please help me,is there any solution???

    You should provide more detailed info, like who is your VPN provider, what VPN protocol (PPTP, L2TP, IPSec,) whether you're on home Wi-Fi, public Wi-Fi, 3G and if public Wi-Fi or 3G, then geographical location. (i.e.: Starbucks on 5th & Broadstreet, Detroit.)

  • My touchpad does not work wiel the keyboard is active #minecraft and gaming plz help.

    Hello I would like to ask a question,  question for the sake of all gamers WHY CANT I LOOK AROUND WIEL MOVING IN GAMES LIKE MINECRAFT , GUILDWARS,  WORLD OF WARCRAFT ALL OF THOSE GAMES REQUIRE YOU TO LOOK AROUND WIEL ADVENTURING.But no my new HP Pavilion wont disables my touch pad for some reason wiel my keyboard is active ! No thanks.....
    Please help me figure this out I have tryed settings but I cant really find anything so your Answers will help Me and other fellow gamers who have boaght new Hp's.  
                                                                                                                                      Thanks -NorthOp1909

    HI @KnowGamesOrNo 
    Welcome to the HP Forums!
    It is a terrific place to find answers.
    For you to have the best experience in the HP forum I would like to direct your attention to the HP Forums Guide Learn How to Post and More
    How Do I Find My Model Number or Product Number?
    I grasp that you would like to disable the touchpad while playing games as it is causing interference.
    Here is a link to Using and Troubleshooting the TouchPad or ClickPad (Windows 8) that should aid in that endeavor.
    Best of Luck!
    Sparkles1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping!

Maybe you are looking for