Does this sound like a good design for simple db lookup?

I want to separate the gui form the behind the scenes stuff so 2 classes. One for the gui (gui.java) and one for the database stuff (dbQuery.java). I know the syntex is not accurate but it's sort of pseudo-code - Here's how it looks:
public class gui extends JFrame {
   string name, address, city, state, id
   public static void main {
      create gui         //all the swing stuff goes here
      actionlistener{          //waiting for button to be clicked
         when button is clicked,
         dbQuery dbq = new dbQuery(id)
         name.setText(dbq.getName())
         address.setText(dbq.getAddress())
         .....        //get the rest of the information needed
class dbQuery{
   dbQuery(string id){
      //do all the stuff to get connection. create statment, get sesult set...
      rs.next();
      string name = rs.egtString("Name");
      //.... assuming all db fields are appropriately named
}This is my first attempt at designing more than "Hello World" and your input truly is appreciated!
Merry Christmas!

I am partial to the database layer and the gui layer using a primitive and collections of primitives to share data.
A primitive is implemented as a class in java but it is not an object. Rather it just serves as a convient way to group the certain attributes together. Like this
     class CustomerPrimitive
          public String name;
          public String account;
          public Boolean preferedCustomer;
          public Double accountBalance;
.When I use primitives I tend to use objects rather than java primitivers (Integer rather than int.) This allows me to use the primitives for queries also - a null means don't query on that. In addition it allows me to return null values as nulls.
It is important that a primitive not have any substantial behaviour. For example there could be a validation method that verifies that the account number is not null. But there must not be a validation method to verify that the account number is unique. The first is implemented using simple java (perhaps with java.lang), while the second requires the interaction of numerous classes.

Similar Messages

  • Does this sound like a dead Time Capsule?

    Came home this aft to no WIFI.  Checked and the light was off on my Time Capsule (first generation) but otherwise intenret connectios seemed OK.
    Powered the TC off/on; green light came on momentarily, changed to orange for about 30 seconds, then went off again.  Repeated the cycle several times with no difference.
    I have noticed recently that the hard-drive in my TC was getting noisy but everything appeared to be working until a few hours ago.
    I recall there were issues with the early Time Capsules and sudden death.  Does this sound like that situation?
    Welcome advice on whether current generation Time Capsules are more reliable or would a better course be to replace it with a generic router and seprate backup disk?
    Thanks ..donald

    Apple treated me well on this.  My TC was 15 months out of warranty when I took it to the Genius Bar.  About the only question asked was "do you have Apple Care on another product?", following which a replacement TC was produced, some paperwork signed and I was on my way.
    Only a couple of reservations: 
    The replacement TC, according to the Genius, is new "service stock" (not a refurnished unit) but the same model as my original TC; i.e. First Generation.  This leaves me guessing it will have about a 2-yaer lifespan as well, so I I should plan on upgrading well in advance.  I'll be listening carefully for strange noises and watching how hot it gets.
    The second reservation is about security of the information on the TC; al the Time Machine backups plus a little bot of other stuff.  The old TC was boxed for return to Apple and I have to trust Apple that it will be securly destroyed.  Trust is a big thing.

  • Does this sound like a logic board problem?  Blue screen

    I have a G4 1.33GHz iBook 14". Recently it has started having problems with freezing and booting. It will boot normally, but a few seconds or minutes into use, if freezes, and only a force shutdown with the power button will work. Then, when it restarts, it may run fine, or may freeze up. Sometimes when it boots, the apple logo shows up, then the spinning wheel, then a light blue screen. And then, nothing.
    I have tried all the usual stuff, including starting with the 10.4 DVD and running disk utility. Also Onyx and version 3.03 of Disk Warrior. It wouldn't boot from the Disk Warrior CD usually, and the one time it did, if froze up.
    SO, I ended up booting it in Firewire Target Disk mode, and reformatting (zero'd out) using my MacBook. Then, reinstalled the 10.4 and upgraded to 10.4.7 using Software Update. It worked fine for about two hours, and then started freezing and blue screening again.
    Does this sound like a logic board thing? It just occurred to me that I haven't tried all this stuff with my additional 1 Gb stick of RAM out. It hasn't caused any problems before, but I suppose it might affect this, no?
    Sorry for the long post, but I want to try to diagnose and fix BEFORE it goes off to Apple to be returned with a "we can't demonstrate the problem" message and a bill.
    Thanks
    Roger

    I took out the 1 Gb stick and it did the same thing. About half the time it boots, works for a little while then freezes up. The rest of the time it won't boot past the spinning wheel then the blue screen. Same deal with the OSX DVD and the DiskWarrior CD.
    Frustrating. I may have to send it in.
    RDS

  • Does this sound like I need a new hard drive for iPod?

    I have an 15GB 3rd generation iPod (4 buttons across top) and now i'm having some major issues. I have to restore constantly and even after a successful restore (which takes about 6-8 tries to keep the restore from freezing) it'll update songs on iTunes if I relaunch the Finder and only if I do that. The hard drive has a clicking noise whenever it's trying to connect to my computer. I'm assuming the clicking is a bad hard drive. Does that sound like it could be the case?

    Thanks. I've tried partitioning and erasing the hard drive a couple times. Once in a while it succeeds in erasing the data and then I can attempt a restore but usually the iPod causes Disk Utility to freeze and I have to force quit or manually disconnect my iPod. After I successfully erased the data my restore attempts are usually unsuccessful anyway. The clicking still occurs and I usually have to try restoring about 3-6 times with various iPod Updaters before I get one that will restore completely. Even after that I can't re-connect my iPod to the computer without having to relaunch the finder.
    I might have to look into an iPod Video or Nano

  • Does this sound like a bad logic board?

    Howdy everyone,
    Tried searching and troubleshooting but I'm at a lost for answers so maybe someone who has experienced the same thing could chime in.
    Our 2009 MBP started experiencing random beach balls a couple months back that gradually developed into full-blown lockups. Eventually the system refused to boot up so I figured it might be a hard drive problem. 
    I tested and verified the hard drive by:
    1) using disk Disk Utility to verify and repair the drive (completed without any issues and S.M.A.R.T. is 'verified')
    2) by installing the hard drive internally on a 2008 MB to see if it worked (booted up and worked just fine)
    3) hooking up the drive to the MBP via USB enclosure and booting up as an external disk (again also worked fine)
    Next I figured it would be the hard drive ribbon cable so I ordered and tried two different ribbon cables, one from an Amazon reseller and one from iFixit.  I get the same result with both cables.  The drive is recognized in Disk Utility but the system refuses to boot and gets stuck at the logo page with the spinning progress indicator.  Booting in verbose mode revealed nonstop disk0s2 i/o errors.
    I've ruled out the hard drive and the ribbon cable at this point so is there anything else that could be the culprit or does it sound like the logic board?
    Thanks in advance for any input you could provide.

    Hi Neurotic
    You maybe in luck, that 24" with the NVIDIA GeForce 7300 GT is rare and unlike most other iMac's can be refitted and with a new graphic's chip. Unfortunately the iMac is very difficult to open and work on, plus you may need an Authorized Apple Service Provider to locate and order the proper graphic's chip.
    For a service provider in the US see > http://www.apple.com/buy/locator/service/
    For service provider elsewhere see > http://www.apple.com/uk/buy/locator/
    Dennis

  • IPod problem - does this sound like a hardware or software issue?

    My iPod (80/video) sometimes plays but without sound. In other words, the time counter progresses, but there is no volume. It is very intermittent, but annoying nonetheless, because I need to restart the ipod to get sound again.
    I've had it back to Apple twice, and they were not able to reproduce the problem.
    Now, after spending a lot more time playing with it, I know how to reproduce the problem.
    This is when it happens:
    1. Pause iPod
    2. Remove headphones
    3. Let ipod turn off by itself
    4. Reinsert headphones / play ipod
    When I turn it back on again, there is no sound from the headphones and I need to restart it.
    So, the normal scenario is that I get to work, pause my ipod, remove the headphones and plug them into my laptop, letting the ipod turn off by itself after a few mintues. When I go to leave again and plug my headphones back in.... no sound.
    It happens with any music file or video file.
    Now, if this is a software/firmware problem, then I will patiently work around it. But if it might be a hardware issue, then I will send it back again, especially now that I know how to reproduce the problem reliably.
    Of course, I've restored the iPod many times and have tried it on different computers with many audio and video files. The problem persists.
    Any thoughts?
    Thanks.
    sam
    5G 80gb   Mac OS X (10.4.9)  

    I have the same problem (sort of). I used to think I was losing the sound output, until I notice that the iPod errouneously and randomly turned the volume down to zero. Since this occurs while I'm driving with the cassette adapter and plug-in power adapter in use, nothing is touching the face of the iPod.
    Now for the bad part. It is now starting to go the other way. I'll be happily listening to the iPod when it suddenly pegs to 100% volume. Sometimes it jumps around - up, down and then to zero.
    I sent my 5th gen 60 gig iPod in for servicing. I got it back yesterday with no repairs and it has already started pegging at 100%. If this isn't a problem with the iPod (according to Apple) then there is a MAJOR software bug that needs to be addressed. I don't like getting "shined on" by Apple just because they didn't reproduce the problem during their half hour of troubleshooting.
    MacPro, MacBook Pro, Mac Mini (Intel), iMac (Intel)   Mac OS X (10.4.9)  

  • My Macbook Pro, circa 2007, does not start up correctly.  It gets stuck opening Finder.   Does this sound like a Hard Drive or other hardware?

    Hello.  Need a little help. My Mac Book Pro is having start-up issues.  I am running Snow Leopard on this computer.  It is bootcamped up to run a PC portion as well.  I started having this problem a few weeks ago.  I tried to back up the drive, but it would not even let me do that.  I wiped it clean (I had a relatively new back-up and it is secondary computer) and reinstalled the OS.  It worked well for a couple of days, but started getting held up with opening the Finder on start-up and it woudl just get stuck.  I am more than willing to pull the drive and install a new hard drive, but that might not be the main issue so I am looking for some assistance before the next wipe out.
    When it was working for a couple of days, I tried to install OS X Lion, but it would not allow me to do so (some installation failure).
    Anyway, should I retire this computer or install a new harddrive....
    Any advice is welcome.
    Dan

    a brody, I will take a look.  The internal drive works (i.e., the battery, it spins, etc.) it just has a bit of trouble recognizing all CD's so I tend to use the external one since it works consistently.  Do you still think this might be the issue?  The apple store told me a week after my extended warranty ran out that the drive should be replaced but that an external drive is not an isse, but that was a while back and this problem just started.

  • Itunes is saying the next update requires 4.37 Gb of free space... does this sound like a lot?

    Why does it need so much space this time?  I regularly update it...

    And what version of the update?

  • 3.6MB for one song?? Does this sound correct?

    I have just downloaded iTunes and I have downloaded one song. At the bottom of iTunes it is telling me that the song is 1 song, 3.6minutes, 3.6 MB. Does this sound like the correct MB size for one song?? I dont want to start downloading more songs if my settings are incorrect. If this is incorrect setting, how do I change it to get smaller MB per song??
    Thanks!

    *If this is incorrect setting, how do I change it to get smaller MB per song??*
    Sorry, purchased content is only available at 128 kbbs (for regular content) or 256 kbbs per second (for iTunes plus content).

  • Does This Sound Good?

    I'm a student and am looking at purchasing a MacBook Pro to replace and old Dell Desktop. On my laptop I plan on having about 40-50Gb of iTunes movies, Music, TV Shows, etc. Also, being a student, I am obviously going to use Microsoft Office all of the time and probably iWork '06. I am also purchasing Final Cut Express HD because I do like to play around and edit digital video. And of course, I do tons of web browsing.
    This is my first mas and this is how I would like to configure it.
    15.4" Display
    2.16GHz C2D
    1GB RAM (I will buy another 1GB stick from newegg.com)
    160Gb Hard Drive
    iWork '06 Pre-installed
    And later in the year when I have more money, get the AppleCare PLan
    Let me know if this sounds like an Okay configuration for my needs.

    Hi,
    that sounds like a config that fits your needs.
    Two suggestions:
    1. Don't buy iWork preinstalled, but play with the 30-day demo, that is already on the HD.
    If you like it, you can buy it later for the same price, if not, you save money.
    2. Instead of MS Office, which with version 2004 isn't Universal Binary (that should come with version 2008 later this year), have a look at NeoOffice.
    It is free and capable of reading the 2007-Windows-file formats.
    Have Fun
    Stefan

  • Hi i received the nano 7th gen for Christmas and I only seem to get 5 hours of battery life. I use the Bluetooth and Nike app so I expect more drain on the battery.  But I got more time out of running with my iPhone. Does this sound normal? I thought I sh

    Hi i received the nano 7th gen for Christmas and I only seem to get 5 hours of battery life. I use the Bluetooth and Nike app so I expect more drain on the battery.  But I got more time out of running with my iPhone. Does this sound normal? I thought I should get close to 30 hrs of just play time alone.
    ALso, my wife got me the Belkin armband to run with the nano but I sweat through the band resulting in the back of the iPod to get wet. Surely this is not good. Anyone have a recommendation for an armband that keeps moisture away from the pod?

    iPod Nano are small and they don't use Wi-Fi access so you get less power time on a Nano. As for iPhone, since you got apps, Wi-Fi + 3G access, and everything else, they give you more time so you can keep using. Nanos are ment to listen to music, listen to radio, view your photos, watch videos (without Wi-Fi) and since you got BlueTooth on the nano, it counts as wireless access so it drains your battery faster.

  • What is a good design for remote Views?

    Hi All,
    I am thinking how would I design my process for performance consideration in retrieving dynamic values of table/view data.
    The requirement is like this:
    1. We have 50 databases residing on each own server counterpart (50 servers).
    2. Each database has table Patch_LeveL (apps_name, patch_level), which contains  just one row only to reflect the latest patch level applied for the apps on this database. Note that are we constantly on applying service packs for this apps.
    3. On our central monitoring server (db). I create 50 database LINKS for each of the 50 databases.
    4. I created 50 views over these links to make  it centralized to represent  the 50 Patch_Level tables. As   patch_level_view1, 2, 3.....patch_level_view50.
    5. I then create a central view as .... as  union of the 50 individual views Actually I am just planning to do the above activity.
    My question is....is this a good design for performance? Can you share be a better approach?
    Is there a limitation of joining "union" of 50 views?
    Thanks a lot,

    Is there a limitation of joining "union" of 50 views?What can happen is if the connection to one of these servers is interrupted, the big "union" view will not work. As said by above poster MV, with lets say an hourly refresh, helps with this situation as you have the data that was gathered last time (and most likely it is still valid).

  • I have an older Ipod touch with 4.2.1 and cannot be updated any further, how do I install apps on it now?  so far every app I have tried says I need an updated IOS.  This sounds like I now have an apple product paper weight.

    I have an older Ipod touch with 4.2.1 and cannot be updated any further, how do I install apps on it now?  so far every app I have tried says I need an updated IOS.  This sounds like I now have an apple product paper weight unless I want to run out and buy the latest and greatest overpriced apple product. 

    Are you willing to buy a newer iPod? How about the 4g @ 16gb for $199* usd or the 5g @ 32gb for $299*.
    * tax not included.

  • I need to use sigma plot in my Mac, does any one has a good advise for alternatives. If not, will it be ok to install windows in my mac?

    I need to use sigma plot in my Mac, does any one has a good advise for alternatives. If not, will it be ok to install windows in my mac?

    See if Deltagraph is still around.  We used to use that for plotting scientific data on Macs.  I don't know if it is at all transferrable with Sigmaplot if you have a colleague who uses it, but if you're doing this on your own I would look at getting DG vs, doing a dual boot  etc.

  • What does this mean:Photoshop 13.1.2 for Creative Cloud Installation failed. Error Code: U44M1P7

    What does this mean:Photoshop 13.1.2 for Creative Cloud Installation failed. Error Code: U44M1P7
    I found the manual update, which worked!
    http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=5595&fileID= 5604

    Hi Barbara,
    For failed 13.1.2 update error U44M1P7, Please refer to the solution mentioned in the following threads :
    http://forums.adobe.com/message/5396792#5396792
    http://forums.adobe.com/message/5409050#5409050

Maybe you are looking for

  • Is there a way for java plug-in to get the browser login authentication

    I have an applet that is loaded from a password protected html page. I use java plug-in with the applet. When I try to read this page I get the browser window asking for password and username. So far so good. Then I log in successfully and starts usi

  • Third Party X-Fi Mode Switching Softw

    I recently ran across an issue which is documented in this thread: http://forums.creative.com/creativelabs/board/message?board.id=soundblaster&message.id=53809 What I found out raised an interesting possibility: it should fairly easy to make software

  • Change rtmfp groupspec with javascript

    hello is it possible to change dynamically the groupspec and play the new rtmfp group? test code   var parameters =                         {       src: "rtmfp://p2p.rtmfp.com/2924a8afa44eaff4aac318fe5b39248d277688d663c6dfb422e6e9663967d39b/"        

  • Parameters to Apex RESTful service

    I am having issues getting parameters to pass to a region I have published as REST. I am using the following URL: http://apex:8000/apex/apex_rest.getReport?app=145&page=2&reportid=RestTest&parmvalues=P2_ID,1969&output=xml And I have the SQL for the r

  • Doesn't it get very old, same question about running dos command?

    To everyone who is tooo lazy to search. Process p = Runtime.getRuntime().exec("progname arg1 arg2"); What a wast of everyone's time responding to the same question on how to run a dos command.