Messenger Strategy? Threading, Networking.

Hello, I am writing a messenger program to interact with Microsoft Telnet (or any plain text command line program, basically I don't want to have a special client to use the server.) and I am running into some issues. I have a server.java which opens a socket, and accepts incoming connections. Once a connection is accepted, the server.java asks for the use name, and then when the name is supplied it spawns a new thread, passing in the socket and the name of the user. The universal user listing class (serverListing.java) is then updated with the names who are logged on. Now here is my problem. I can't think of a way to get text from one client, and then publish it to all of the other clients. I hope that I have described it enough to not have to post the code, simply because it is large. But if you think it would help let me know! Thank you for your time in advance!

Simplest way to do this ind of work is to have two
threads for each socket and a queue.
One thread should keep reading the socket input
stream and post that data in to a queue.
The other thread should read the queue and write to
the socket output stream.That will double the necessary numebr of threads, and though "cheap", threads aren't "free".
For the record, my suggestion is based on a working chat application.

Similar Messages

  • Threading Network code in a Swing Application

    For my final High school project i have decided to code a Poker game to be played over the network. Problem is, as soon the host starts waiting for a client to connect, everything Swing related freezes. A friend of mine said to use Threads.
    Strangely enough, when i made a small example class, this did not happen.
    Any e-books,ideas examples about threading please?or a solution to this 'freeze' problem?
    Message was edited by:
    Naks

    There is a ton of stuff in these forums and elsewhere on usage of SwingWorker. It may be helpful to google this and also open the Sun tutorials on concurrency and Swing, and study the the articles.
    Good luck!
    /Pete

  • NOKIA 6630 MSN MESSENGER and 3 network

    Hello
    i have an old? good working nokia 6630. I am on 3 pay as you go. I recently installed MSN Messenger, 3 tell me it won't work, but it does!
    I can see all my contacts, but it looks like they can't see me, or receive my messages. I have no credit on phone, but 3 say msn messenger is free to use.
    What is wrong with phone that I appear OFFLINE in MSN messenger?
    liz

    Hello
    i have an old? good working nokia 6630. I am on 3 pay as you go. I recently installed MSN Messenger, 3 tell me it won't work, but it does!
    I can see all my contacts, but it looks like they can't see me, or receive my messages. I have no credit on phone, but 3 say msn messenger is free to use.
    What is wrong with phone that I appear OFFLINE in MSN messenger?
    liz

  • Blocking yahoo messenger

    Hi! I jst want to know how to block yahoo messenger on the network using wag54g. thanks

    I am using WRT54G (Firmware Version: v1.02.5)
    I also would like to block YM in my network. However, I want to have 2 rules:
    1. Block internet from 10PM until 10Am next day
    2. Block chat from 9PM until 8pm next day (i.e. leaving 1 hour unblocked)
    How can I config those 2 rules to some MAC numbers? Thanks.

  • Using iSight with MSN Messenger

    I have MSN messenger 5.0 for a Mac - I cannot seem to figure out how to use the iSight with it . Has any1 been able to do this or are the 2 not compatible?
    Thanks

    Hello Alefiyah,
    Welcome to Apple Discussions.
    Grant it right. No video in MSN for Mac.
    If you are interested, see the MSN, Yahoo, Win Messengers & iChat? FAQ for info on how to use iChat AV with MSN Messenger for text chat.
    Has any1 been able to do this or are the 2 not compatible?
    Not currently. See Peter Tulipan1's recent Can iChat have video chat with Windows Messenger? thread for info about the development of video via the MSNM Server by using an application called Mercury Messenger on the Mac. Note that their Support Info says two-way video does not work at this time, though.
       <small>EZ Jim</small>
    (P.S. You really
    b should
    update to 10.4.2. It correct several issues with the previous Tiger versions. I suggest the 58 MB Mac OS X Update 10.4.2 Combo. I also suggest that you repair permissions
    b before AND after
    the update. See Gulliver's Mac OS X 10.3/10.4: System maintenance FAQ for why.)

  • To Host-"Slow script" message on overlong thread

    To Host,
    I've been following this overlong thread "Network Preference Pane gone berserk..."
    http://discussions.apple.com/thread.jspa?threadID=1712387&tstart=0
    and getting a "slow script" message two or three times using Safari, and need to keep clicking on the "continue" button before it will load completely. Very slow with Firefox also, but without the message.
    I don't know if it's me or the server in this situation, but would it help, perhaps, to break it up into pages to eliminate this problem? I thought that was what was usually done with such long threads.
    Also- to hosts- as you must have seen, there have been numerous reports concerning this particular problem with Security Updates 2008-006/7. I know this is a user to user forum and that your job is not to reply to technical issues, but I've been told that Apple technical does monitor these forums. Do you have any way of knowing if Apple is going to take some action in the form of an official announcement or a response of some kind?
    Thanks.

    Hi WZZZ!
    In Your Settings, change the Topic Page View: to Flat.
    You can also adjust the Topics per Forum Page: in that view.
    In Threaded, all responses are displayed on the same page.
    ali b

  • How to create a game. Basic steps.

    So, just browsing through these forums, I see many posts by prospective game designers wanting to get started. But many of these questions are so ill-researched or off basis that most people don't even know how to respond.
    So here's a quickie guide on how to get started learning to make a game. Notice I didn't say making a game. First you learn, then you make, or else you'll just get frustrated and quit.
    Here's the basic steps:
    1) You need to learn Java. Seriously, don't even think about writing a game if you don't want to. Get a book. My favorite was one by Ivor Horton. But really, any will do.
    If Java is your first programming language, it is important for you to read through the book carefully and do the excercises. This is for you learn what a "programming language" actually is.
    All a computer can do is add numbers. A computer itself knows nothing about Mario or how to make Mario jump. So YOU have to figure out, just what does Mario have to do with numbers.
    2) Write a simple game, without animation in it.
    My first game was Minesweeper. Other examples include Solitaire, or Poker, etc...
    This teaches you how to organize a "large" program. Organization is important. If you don't organize, you'll begin writing a game, and eventually get stuck because your code is unreadable, and your bugs will be impossible to trace down. You'll be frustrated and quit.
    3) Learn the concepts behind animation and a 2D game.
    I see questions like: "I want to make a game, and I drew Mario. Now how to I make him move?". This is for you people.
    Animation is drawing a bunch of images in rapid succession. And a game, basically is a logic system that decides which animations to play at any given time.
    4) Write a 2D game.
    Now, you are ready to attempt an actual game. I started small and wrote a tetris-esque puzzler as my first game with animation. I suggest you do the same, but if you feel ready you can probably jump into a major project now.
    5) Learn about 3D.
    For those aiming high, you can get started learning the concepts behind 3D now. I suggest you know at least a basic knowledge of trigonometry. This means know your sin, cos, and tan inside out, or else you'll up for a lot of work.
    3D is not like 2D. There are quite a few concepts that you will need to learn, and they're not immediately intuitive. Those who have a stronger math background will progress faster. Those who have a weaker background will find it more difficult. But you'll learn a lot along the way. Nothing teaches trig faster than writing a 3D engine.
    6) Write a 3D engine.
    You're entering the hardcore right about now. Few people on this forum will have experience with this and you'll need to do a lot of thinking. Mainly, just because, there's not many people left to ask.
    Some of you will have some ideas on writing this engine. In this case, I recommend you go ahead and try. You might not succeed, but trying will teach you more than anything else.
    Those that don't quite have it down yet, or those that tried and didn't quite succeed can follow along with a book that takes you through this step. The book that I used was "Java game programming". It has a very in-depth section on 3D.
    7) Make your engine fast.
    This step is probably the hardest of all. If you completed step 6, you'll notice that writing a 3D engine, and writing a fast 3D engine is two almost completely different things.
    Here's when you'll research into various computer science algorithms and techniques in order to speed up your engine. Actually, this is when you'll probably learn the concept of "algorithm".
    This is research! You'll find almost no help at forums for this step. Nothing but hard work.
    I can't comment on more than that, as that's as far as I've gotten so far. But that's the basic roadmap.
    Good luck on your games.
    -Cuppo

    Okay I am going to add a few points since they have come up recently.
    With relation to what you should know with Java.
    Beyond the basics you should get a good grounding in the following
    - threading
    - networking in Java (if applicable)
    Threading
    For threading you can use the concurrency tutorial found here http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html
    Threading is really a must. No kidding. Because you will be unable to do anything performance wise without it. Additionally you can't normally take a non-threaded application and slap threading on it. You need to have a design that incorporates being threaded.
    You also don't want to come up with a design to find out later that it's wrong. Don't be afraid to ask questions about your design in general and as how it relates to threading.
    Making a good multi-threaded application is actually not all that difficult, once you understand it. But this is the thing that seems to trip up alot of people. I see an awful lot of bad threading code in the Java Programming forum. Tip: If you are using Thread Priorities you are doing something wrong!
    Networking
    The Java networking tutorial may be found here http://java.sun.com/docs/books/tutorial/networking/index.html
    This is a basic tutorial though so don't assume you know everything there is to know once you have finished it. If you are serious about your development then I HIGHLY recommend the following book
    http://books.google.com/books?id=l6f1jTB_XCYC&dq=Fundamental+Networking+in+Java&psp=1
    As a bonus the author is a long-time member on these forums and a regular in the Networking forums.
    Networking your program, especially depending on how you will use it is important to design into your game from the get-go. If you are planning to make a multi-player online game you need to know what the limitations are with regards to performance early in your development. If you build a beautiful game but it runs like a dog because of what you did in your networking code it would be a real shame and worse it may not be fixable.
    Again don't be afraid to ask questions.
    Restatement of CuppoJava's Comments
    This is a good thread and that's why I am adding these comments to it. I would also say that I totally agree with the sentiments on what you should expect.
    If you are new to Java and expect that in just a few months you are going to crank out a game with a custom 3-d engine you are in for a nasty surprise.
    It isn't that we want to be discouraging, but please do try and set yourself realistic goals and time deadlines. You'll find it a much more positive experience and the less frustrated you are the more likely we are to be able to help you. :)

  • XE and "Cannot find server or DNS Error"

    I read other articles and here is some data for your to go over.
    =====================================================================
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Nov 28 09:37:18 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    SQL> connect / as sysdba
    ERROR:
    ORA-12631: Username retrieval failed
    SQL>
    ==================
    C:\>lsnrctl status
    LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 28-NOV-2006 08:19
    :39
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Produ
    ction
    Start Date 27-NOV-2006 16:14:11
    Uptime 0 days 16 hr. 5 min. 27 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Default Service XE
    Listener Parameter File C:\oraclexe\app\oracle\product\10.2.0\server\network\a
    dmin\listener.ora
    Listener Log File C:\oraclexe\app\oracle\product\10.2.0\server\network\l
    og\listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC_FOR_XEipc)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jantar)(PORT=15
    21)))
    Services Summary...
    Service "CLRExtProc" has 1 instance(s).
    Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    Also netstat does not show anything running on port 8080.
    ============================================
    C:\Documents and Settings\N0139838>net start
    These Windows 2000 services are started:
    Alerter
    COM+ Event System
    Computer Browser
    DHCP Client
    Diskeeper
    Distributed Link Tracking Client
    Distributed Transaction Coordinator
    DNS Client
    EPAService
    Event Log
    Infrared Monitor
    Logical Disk Manager
    Machine Debug Manager
    Messenger
    Net Logon
    Network Connections
    OracleServiceXE
    OracleXETNSListener
    Plug and Play
    Print Spooler
    Protected Storage
    Remote Access Connection Manager
    Remote Procedure Call (RPC)
    Remote Registry Service
    Removable Storage
    RunAs Service
    SafeBoot Configuration Manager
    SavRoam
    Security Accounts Manager
    Server
    SMS Agent Host
    SMS Remote Control Agent
    SU Service
    Symantec AntiVirus
    Symantec AntiVirus Definition Watcher
    Symantec Event Manager
    Symantec Settings Manager
    System Event Notification
    Task Scheduler
    TCP/IP NetBIOS Helper Service
    Telephony
    Windows Management Instrumentation
    Windows Management Instrumentation Driver Extensions
    Windows Time
    WMDM PMSP Service
    Workstation
    The command completed successfully.
    ===========================================
    Ping 127.0.0.1 or localhost is successfull.
    ===============================================
    C:\Documents and Settings\N0139838>netstat -a
    Nothing is running on port 8080.

    Accoding to your listener status, it is actively listening on behalf of host 'jantar', but NOT listening on behalf of host 'locahost'.
    What happens when you "ping jantar"?
    Are you using DHCP?

  • IPhoto launching at startup, iSight no longer works, 10.4.8 to blame?

    My built-in iSight (first 17" intel iMac) is "in use by another application" when I attempt to use it from iMovie, iChat, or Photo Booth. When I tried disconnecting everything and rebooting, I discovered that iPhoto is launching at startup.
    The only thing I can think of that has changed recently is a system update about a week ago, including 10.4.8 and whatever apps were updated.
    iPhoto is not set to launch in either the StartupItems folder or my user's login items. It also does not show as checked when I ctrl-click on it in the dock.
    So far I've tried resetting the PRAM and installing MacOSXUpd10.4.8Intel.dmg to no avail. I see a reference to a "Combo Update" in another unrelated thread (network problems). Does anyone recommend this? Or am I just hosed until 10.5 comes out.

    Problem solved. It was a digital camera driver which is no longer compatible since the new update.
    03: Check your system console and see if you have any malloc errors. Are you using anything you had to install drivers for? You get the starfish for being considerate enough to reply. I hope you get it worked out.

  • Premiere Elements has encountered an error (Preferences.cpp-347)

    Hi all
    System: Windows 7 x64, Adobe Premier Elements 12.0
    We are getting the following error when attempting to start a new project under one specific user.
    Premiere Elements has encountered an error [..\..\Src\Core\Preferences.cpp-347]
    I have read in other threads network installations can cause this.
    This is a network installations and we do redirect my documents to a network drive.
    I have tested this under Administrator and test accounts where my documents were not redirected and it started a new project fine.
    Other threads have mentioned that there is a possible fix and to contact customer support. I have tried to do this by logging in to this Adobe account but the only option was to Ask the Community.
    Has anybody been provided with the solution to this?
    I have tried the following but to no avail:
    -deleting the preferences file
    -deleting the 12.0 folder
    -adding access rights of the user to all adobe premiere related folders
    -looking through the registry for elements related entries and looking for related paths
    Thanks in advance

    I have searched the net for trying to find a solution but cant find any. Im sure Adobe must find a solution to this problem.

  • 4th gen tc and wd book live work to gather?

    i have a 4th gen tc and was going to use it specificlay for backing up my macbook pro, i also have multiple pc running windows and wanted to back those up also but not on the tc because i dont want to mix them all on one back up. i saw that wd has a live book that will back up both mac and pc and will file share over the nas network. that is great for file sharing and using out of the office. i also have a netgear wireless router that i stopped using since i installed my tc. am i buying too much equipment or is the configureration going to be able to work ?

    If the strategy is network backup then there are boxes that are more capable than the TC.. that is for sure.. particularly windows does not easily work with the TC.
    How many computers are you talking about? I presume this is just a peer to peer network and you have no server??
    A NAS like the WD Livebook although very much the low end, can work..
    How much data would you be backing up on all the windows computers?
    Would using USB hard disk directly plugged into the computer be better?
    It has advantages.. no network traffic.. rather faster backup.. and being local has no issues with network problems or getting lost or strange disk formats. USB drives are cheap.. using several of them you can rotate them around the computers and have one or two offsite.
    You can also create a disk image on the TC since it has 3TB and backup each computer so you have an image even if you don't use it as regular backup location.
    If you run a business.. and computers and data are vital to it..
    1. You should be paying somebody to do this.
    2. If you don't have a specialist on staff or contractor.. be as paranoid as you can be.. Your data is your business.. lose it and lose your business. If a computer out means a staff member sits and fiddles their thumbs.. or sweeps the floor.. have redundancy for everything. It is cheaper than staff doing nothing.

  • Connecting to database help

    First let me say sorry as i have already started this post in another thread, but know one seems to be replying to it any more. the other thread can be found out: http://forum.java.sun.com/thread.jspa?messageID=9413573
    package coreservlets;
    public class Catalog {
    private static CatalogItem[] items =
        {new CatalogItem
            ("hall002",
             "<I>Core Web Programming, 2nd Edition</I> " +
               "by Marty Hall and Larry Brown",
             "One stop shopping for the Web programmer. " +
               "Topics include \n" +
               "<UL><LI>Thorough coverage of Java 2; " +
               "including Threads, Networking, Swing, \n" +
               "Java 2D, RMI, JDBC, and Collections\n" +
               "<LI>A fast introduction to HTML 4.01, " +
               "including frames, style sheets, and layers.\n" +
               "<LI>A fast introduction to HTTP 1.1, " +
               "servlets, and JavaServer Pages.\n" +
               "<LI>A quick overview of JavaScript 1.2\n" +
               "</UL>",
             49.99),
          new CatalogItem
            ("lewis001",
             "<I>The Chronicles of Narnia</I> by C.S. Lewis",
               "The classic children's adventure pitting " +
               "Aslan the Great Lion and his followers\n" +
               "against the White Witch and the forces " +
               "of evil. Dragons, magicians, quests, \n" +
               "and talking animals wound around a deep " +
               "spiritual allegory. Series includes\n" +
               "<I>The Magician's Nephew</I>,\n" +
               "<I>The Lion, the Witch and the Wardrobe</I>,\n" +
               "<I>The Horse and His Boy</I>,\n" +
               "<I>Prince Caspian</I>,\n" +
               "<I>The Voyage of the Dawn Treader</I>,\n" +
               "<I>The Silver Chair</I>, and \n" +
               "<I>The Last Battle</I>.",
             19.95),
          new CatalogItem
            ("alexander001",
             "<I>The Prydain Series</I> by Lloyd Alexander",
               "Humble pig-keeper Taran joins mighty " +
               "Lord Gwydion in his battle against\n" +
               "Arawn the Lord of Annuvin. Joined by " +
               "his loyal friends the beautiful princess\n" +
               "Eilonwy, wannabe bard Fflewddur Fflam," +
               "and furry half-man Gurgi, Taran discovers " +
               "courage, nobility, and other values along\n" +
               "the way. Series includes\n" +
               "<I>The Book of Three</I>,\n" +
               "<I>The Black Cauldron</I>,\n" +
               "<I>The Castle of Llyr</I>,\n" +
               "<I>Taran Wanderer</I>, and\n" +
               "<I>The High King</I>.",
             19.95),
          new CatalogItem
            ("rowling001",
             "<I>The Harry Potter Series</I> by J.K. Rowling",
             "The first five of the popular stories " +
               "about wizard-in-training Harry Potter\n" +
               "topped both the adult and children's " +
               "best-seller lists. Series includes\n" +
               "<I>Harry Potter and the Sorcerer's Stone</I>,\n" +
               "<I>Harry Potter and the Chamber of Secrets</I>,\n" +
               "<I>Harry Potter and the " +
               "Prisoner of Azkaban</I>,\n" +
               "<I>Harry Potter and the Goblet of Fire</I>, and\n" +
               "<I>Harry Potter and the "+
               "Order of the Phoenix</I>.\n",
             59.95)
      public static CatalogItem getItem(String itemID) {
        CatalogItem item;
        if (itemID == null) {
          return(null);
        for(int i=0; i<items.length; i++) {
          item = items;
    if (itemID.equals(item.getItemID())) {
    return(item);
    return(null);
    Using the above servlet and this one:
    package coreservlets
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class browser extends HttpServlet {
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response)
          throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
         Connection conn = null;
         try{
             Class.forName("com.mysql.jdbc.Driver").newInstance();
         } catch(Exception e) {
             System.out.println(e);
         // connecting to database
         try{
             conn = DriverManager.getConnection
            ("jdbc:mysql://MY WEB ADDRESS FOR THE SQL TABLES GOES HERE");
              // System.out.println("Connection to database successful.");
           catch(SQLException se) {
             System.out.println(se);
         try{
              // Get the category from the input form
              String categoryString = request.getParameter("category");
              // check if no category
              if (categoryString == "") categoryString = "Action & Adventure";
             String selectSQL = "select title, director, rating, year_released, price, stock_count, image_name "+
                                "from video_recordings "+
                                "where category = '" + categoryString + "'";
             Statement stmt = conn.createStatement();
             ResultSet rs1 = stmt.executeQuery(selectSQL);
          // output html headers
          String title = "Films in the " + categoryString + " genre" ;
           out.println(ServletUtilities.headWithTitle(title) +
                    "><BODY BGCOLOR=\"#a00e0e\">\n" +
                  "<center><img src=\"http://localhost:8080/examples/pic.jpg\" width=350 height=200/></center>\n" +
                    "<H1 ALIGN=\"CENTER\">" + title + "</H1>\n");
           out.println("<TABLE BORDER=1 ALIGN=\"CENTER\">\n" +
                    "<TR BGCOLOR=\"#FFAD00\">\n" +
                    "  <TH>Title\n" +
                    "  <TH>Director\n" +
                  "  <TH>Rating\n" +
                  "  <TH>Year Released\n" +
                  "  <TH>Price\n" +
                  "  <TH>Number in stock\n" +
                    "  <TH>image name"
    // Retrieve the results
             while(rs1.next()){
                  out.println("<TR>" +
                              "<TD>" + rs1.getString("title") + "</TD>" +
                              "<TD>" + rs1.getString("director") + "</TD>" +
                            "<TD>" + rs1.getString("rating") + "</TD>" +
                            "<TD>" + rs1.getDouble("year_released") + "</TD>" +
                            "<TD>" + rs1.getString("price") + "</TD>" +
                               "<TD>" + rs1.getString("stock_count") + "</TD>" +
                              "<TD>" + rs1.getString("image_name")  +"</TD>\n");
                             "<TD> <IMG SRC=\"../images/music/" + image_name +"\">"
        // close the html
        out.println("</TABLE></BODY></HTML>");
    // Close the stament and database connection
             stmt.close();
             conn.close();
         } catch(SQLException se) {
             System.out.println(se);
      }How do i merge these two together so that a catalogItem is created by connecting to the database and uses the select statement?? If any one can help me here i would be really grateful as i am having real trouble with this.

    Below is what i have come up with (I cut out the code that just gets in the way for this post, eg the connect to database and import statements) My problem is this would only work once has i need to add the item to the array addedItem in the first for loop, can anybody help me with this has i have tried a number of ways but can't get it to compile.
    private static CatalogItem[] addedItem
    private static CatalogItem[] ItemsInCat;
    CatalogItem item;
    CatalogItem details;
            int recordingidDB;
         String directorDB;
         String titleDB;
         String categoryDB;
         String imageDB;
         int durationDB;
         String ratingDB;
         String yearDB;
         float priceDB;
         int StockDB;
    // Create select statement and execute it
         try{
             String selectSQL = "select title, director, rating, year_released, price, stock_count, image_name "+
                                "from video_recordings " + "'";
             Statement stmt = conn.createStatement();
             ResultSet rs1 = stmt.executeQuery(selectSQL);
             while(rs1.next()){
              recordingidDB = rs1.getInt("recording_id");
              directorDB = rs1.getString("director");
              titleDB = rs1.getString("title");
              categoryDB = rs1.getString("category");
              imageDB = rs1.getString("image_name");
              durationDB = rs1.getInt("duration");
              ratingDB = rs1.getString("rating");
              yearDB = rs1.getString("year_released");
              priceDB = rs1.getFloat("price");
              stockDB = rs1.getInt("stock_count");
               item =
               new CatalogItem
                  (recordingidDB, directorDB,titleDB, categoryDB, imageDB, durationDB, ratingDB, yearDB, priceDB, stockDB);
         String title = "Catalog Items";
    out.println(ServletUtilities.headWithTitle(title) +
                    "<BODY BGCOLOR=\"#a00e0e\">\n" +
                  "<center><img src=\"http://localhost:8080/examples/img.jpg\" width=350 height=200/></center>\n" +
                    "<H1 ALIGN=\"CENTER\">" + title + "</H1>\n");
         // loop to go over each item in the array of catalogItem
             for  (int i=0; i < ItemsInCat.length; i++) {
               out.println("__________________________");
               details = item;
         if (details == null) {
    out.println("SORRY THERE HAS BEEN AN ERROR ");
         } else {       
    addedItem[] // needd to store item in array here
         out.println(titleDB + "\n" + priceDB + "\n");
         out.println("</BODY></HTML>");
         public static CatalogItem getItem(int recordingidDB) {
         CatalogItem item;
    for(int i=0; i<itemsInCat.length; i++) {
    item = itemsInCat[i];
    if (recordingidDB.equals(item.getItemID())) {
    return(item);
    return(null);
    // Close the stament and database connection

  • Can anyone please help with this problem... (home page access)

    read other articles and here is some data for your to go over.
    =====================================================================
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Nov 28 09:37:18 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    SQL> connect / as sysdba
    ERROR:
    ORA-12631: Username retrieval failed
    SQL>
    ==================
    C:\>lsnrctl status
    LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 28-NOV-2006 08:19
    :39
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Produ
    ction
    Start Date 27-NOV-2006 16:14:11
    Uptime 0 days 16 hr. 5 min. 27 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Default Service XE
    Listener Parameter File C:\oraclexe\app\oracle\product\10.2.0\server\network\a
    dmin\listener.ora
    Listener Log File C:\oraclexe\app\oracle\product\10.2.0\server\network\l
    og\listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC_FOR_XEipc)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jantar)(PORT=15
    21)))
    Services Summary...
    Service "CLRExtProc" has 1 instance(s).
    Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    Also netstat does not show anything running on port 8080.
    ============================================
    C:\Documents and Settings\N0139838>net start
    These Windows 2000 services are started:
    Alerter
    COM+ Event System
    Computer Browser
    DHCP Client
    Diskeeper
    Distributed Link Tracking Client
    Distributed Transaction Coordinator
    DNS Client
    EPAService
    Event Log
    Infrared Monitor
    Logical Disk Manager
    Machine Debug Manager
    Messenger
    Net Logon
    Network Connections
    OracleServiceXE
    OracleXETNSListener
    Plug and Play
    Print Spooler
    Protected Storage
    Remote Access Connection Manager
    Remote Procedure Call (RPC)
    Remote Registry Service
    Removable Storage
    RunAs Service
    SafeBoot Configuration Manager
    SavRoam
    Security Accounts Manager
    Server
    SMS Agent Host
    SMS Remote Control Agent
    SU Service
    Symantec AntiVirus
    Symantec AntiVirus Definition Watcher
    Symantec Event Manager
    Symantec Settings Manager
    System Event Notification
    Task Scheduler
    TCP/IP NetBIOS Helper Service
    Telephony
    Windows Management Instrumentation
    Windows Management Instrumentation Driver Extensions
    Windows Time
    WMDM PMSP Service
    Workstation
    The command completed successfully.
    ===========================================
    Ping 127.0.0.1 or localhost is successfull.
    ===============================================
    C:\Documents and Settings\N0139838>netstat -a
    Nothing is running on port 8080.

    Hi,
    Have you install Oracle XE as an Administrator or member of Administrators group?
    Have you ever started the Oracle home page?
    Do you have any other Oracle installation?
    What kind of OS do you use? I can see Windows 2000.
    Those two services OracleServiceXE and OracleXETNSListener are enough to run XE.
    You could check by the Task Manager:
    - OracleServiceXE should be about 50K
    - OracleXETNSListener – 6K
    Turn those services to Manual. Restart the computer and Start Oracle database.
    You can check the LISTENER.ORA. Host should be your host name. Same into TNSNAMES.ORA. If the HOST = YourComputerName there are OK.
    Then you should check for any firewall. For instance, Zone Alarm could prevent to access your database.
    I hope that would help.
    Konstantin

  • Any handy client/server patterns?

    Hi!
    I'm building a client/server application that communicate using Serializable Objects.
    For example, the application need to do request/response, waiting for the result.
    This could be a request to store items, or to retreive a list of items.
    The Server need to send messages to applications which will handle them right away, as they arrive.
    This could be as simple as a displaying a message to the user of the application, or a message interpreted by the application itself.
    I'm thinking of something "event driven", Publish/subscribe looking implementation.
    One application should be able to respond to events originated from another application.
    One of the problems is that the application cannot receive messages from the server while it is waiting for the result of a request/response.
    Do you know of any patterns that cover this or somehting similar?
    I can think of either some multiplexing scheme or separate threads/ network connections.
    But as allways, its easier to reuse something allready working :)
    - Flexibility over performance is prefered
    - There will never (ehum) be more than 10 active users at a time
    - The request/response messages scheme need not be very fast
    - The "small" messages (events) must be handled almost instantly (one user sees changes made by another user)
    - The size of the messages is small. Either a few lines of code (events, commands), or a dozen records (query results)
    - The number of messages is small
    / Ronnie

    The Model-View-Controller design pattern solves these problems by decoupling data access, business logic, and data presentation and user interaction.
    A

  • Security update broke my WiFi

    Just installed the latest security update (2008-6) via software update (on my iBook) and now I can't access my WiFi. My network is visible but then I try and connect I get the message that the password is incorrect. I've re-entered the password using Internet Connect then it tells me there's an error connecting to the network. The password in the keychain is correct. I've tried to create a new 802.1X connection from Internet Connect but this option is grayed out.
    Please help
    Many thanks

    I had the same problem on my iMac G5 this morning. I was able to fix it using some advice in a discussion thread "Network Preference Pane Gone Berserk after Latest Security Update (Tiger)" from tonza. There is a message posted Sept 20 at 2:05 AM that recommends removing some preference files and recreating the network configuration. That worked for me and my WiFi came back immediately. I didn't have all of the problems discussed in this thread. You probably ought to read some of the other messages to convince yourself that this is the problem that you are seeing.
    I had a recent backup that I could boot off of or I would have never found this. Make a backup first!
    Good luck!!

Maybe you are looking for

  • Recovery from crashed drive - PSe3 files with tag info?

    Hi, I've had a crashed hard drive which I cannot now boot from. So without being able to reboot, I can't start PSE3 and view the photos and the tags in the organiser. I do have one back up but it was done some time ago and, since then, I've added qui

  • Any new reference material

    I'm really just getting started with DiAdem and have the "Getting Started Guide" and the "Data Mining, analysis and report generating guide" from NI.  However, they give descriptions of what can be done such as the FFT with a pretty report, but now r

  • SQL Server Expcts Value Where Field Is NullI

    I am working on an application in Visual Basic 2010 using an SQL Server 2005 Express The field in the database causing a problem is one of 25 similarly named fields(Track1 through Track 25 with several other fields preceding the tracks, My Visual Bas

  • HttpConnection in background and UI thread in front causes lockups !

    Hi , Iam running a midlet on Tre0 600 using IBM J9. (CLDC1.0/MIDP2) The design of the midlet is as follows. I have a main form with some items on it. (items are xml forms) When i select a item (form) fill it and submit, i put the data to be requested

  • How to check/resolve Unknown Device?

    I have HP Pavillian DV2416us with Windows Vista Business.  In Device manger list, there is 2 device listed under Other Device Category, shows these are not properly installed. 1st one is named Coprocessor and 2nd is named Unknown Device. I tried to c