How can I get a date without the hour from sql server 2000 ?

hellou!
I have a JTable, and one of it's columns has to show a date. This date i have to show is specified as datetime on the Sql Server 2000 database where I have to take the data.
the query of the dataset attached to the JTable is something like "select * from Table".
The problem is that the JTable column that displays the date shows the date and the hour, for example:
7/10/04 0:00:00
and I need to show the date without the hour, only the 7/10/04. Can anyone tell me how to do that?
thank you very much! : )

The easiest way to format a date is with java.text.SimpleDateFormat. When creating it you pass a format string which can be used to parse or format date objects.
SimpleDateFormat formater = new SimpleDateFormat( "MM/dd/yyyy" );
// Get date objects directly from sql
Date foundDate = result.getDate( 1 );  //where result is the ResultSet and 1 is the date column
String formatedDate = formater.format( foundDate );Now the JTable's table model can be adjusted to store a formated String instead of a Date. If for some reason it is required to store the value as a Date overload the table model to return the formated string when getValueAt is called.

Similar Messages

  • How can I get iTunes to display the tracks from a CD in their original (album) order?

    To be absolutely honest, I don't really understand what this box is for, so I shall just use it to repeat and expand on my question. (I have already sent a "Feedback" comment on the same topic).
    How can I get iTunes to display the tracks from a CD in their original (album) order?
    It seems to me that there is something very basic wrong with the way iTunes handles CD Tracks.
    Professionally produced CD tracks are seldom if ever in a randomised order. Why then does iTunes seem unable to display the tracks in the order they appear on the original CD source - whether from a personally owned CD or from a download from the iTunes Store?
    Some music demands a specific, non-alphabetic sequence in order to make sense. Why does it seem that iTunes only offers Alphabetic, or reverse alphabetic order - both of which make a nonsense of the original, often intended order of tracks?
    Why not replace the so-called "cover-art" in the bottom left hand corner if the iTunes window - which, while it may look attractive to some, gives the barest of information concerning the original disc, with a list of the original CD tracks in their original order, so that the user can easily reestablish the order in which they should be played.
    As I would expect legibility might be a problem with doing this, why could not the original contents, (in their original order), at least, be displayed when the "cover art" is double clicked-on - the result of which at present gives me an enlarged version of the "Cover Art". While on the subject of the contents of the source disc, what about all the album notes which someone takes trouble to write in order to increase the appreciation of the music on the CD and the listener's general background knowledge of the artists involved. Such notes, it seems to me, have considerable intrinsic value in their own account. I would, I think, normally be prepared to buy such "Sleeve notes" - so long as a "taster" was supplied (as it is for the music) - for something like the cost of a single 'Tune" on iTunes.
    These two aspects let Apple iTunes down enormously, in my opinion. I think that by chopping even quite protracted sequences of music up into bits does no one any favours - except perhaps Apple's already quite substantial bank balance. People have to be aware that two and a half, to three and a half minutes is a very short time to develop a piece of worthwhile music, and that there are many, many composers, not all of whom are alive today who have written music that huge masses of mankind value for the enrichment of their lives and the human condition in general.
    Please make the viewing of iTunes tracks in their correct order by default possible. By all means have the alphabetical variations available as offering a different approach to the music, but not the sole approach to it - PLEASE.
    Frustratedly yours
    Alan Whitaker
    PS I work at my old 24" iMac Intel Core 2 machine which runs OS "Tiger" - because it is more beautiful to look at, the screen is more pleasant to work on, and because, in some ways it is more capable (it will run FreeHand MX without needing a "patch"), than my more recent 21.5" which runs "Snow Leopard". (I don't find it that much slower, either).

    Dear Mike
    Thanks for the support. I am utterly amazed that after all the hype about how good iTunes is that it cannot play a downloaded CD in the correct order, and that what that order should be is not available directly from within one's own iTunes installation. (I know that one can go back to the iTunes Store to check what the order should be, but having downloaded the tracks surely iTunes is clever enough to retrieve this important information.
    My iTunes to differ from yours in that I have also noticed that it seems unable to download copies of my "talking books" in the correct order either. But in my case it downloads them - from a CD - in order, but with the first track downloaded first - so that it appears at the bottom of the column of tracks so that it would get played last! (At least this is, while being inexplicable, a relatively "logical" bit of blundering and because of this is relatively easy to put right!).
    I like many genres of music, some of which are not really programmed except perhaps by the artist performing them. I know that Frank Sinatra was very careful to programme his album songs to obtain a particular effect and in relation to the keys of the music. iTunes presumes to know better.
    Film scores may be totally randomly put together, in some cases, but in others the order is vital to one's appreciation of the music as a whole and how it relates to the plot of the film.
    In symphonic music most works are divided into sections and are conceived by the composer that way. Some individual sections may gain a life of their own if played separately, but they are never complete in the sense that the composer envisaged them without being placed in their proper context.
    Opera and probably most choral music too, is similar except that the words may well become meaningless if the order is changed at the whim of a piece of ill-written computer code, while ballet music has to be heard totally within its sequential context or it becomes meaningless.
    Finally, I would venture that iTunes, by jumbling up the order of the tracks as recorded on a CD, does an immense disservice, not only to the music on a particular CD, but to music in general, by expressing everything in terms of "Songs" - which it seems to interpret as stand-alone items of between 2 and 4 minutes whatever the genre. Even the way the iTunes publicity speaks of how many "songs" it can store instead of how many minutes or hours of recorded sound. This has to be another brick in the wall of "dumming-down" of people's expectations, and the shortening of their attention spans.
    I don't know about anyone else, but I feel betrayed by Apple over this. Perhaps the look, feel and general presentation of an item are not the most desirable features of a consumer product. Maybe it should be judged more on it fitness for the purpose for which it was sold. There is one other possibility - that Apple are trying to redefine "Music" - and that everything that lasts longer than about 3.5 minutes or is in the form of what could for want of a better term be called symphonic in the broadest sense is something else - not "Music" within Apple's new definition, at all!
    Well that's off my chest! now I can get down to creating some sort of order in my iTunes Libraries, knowing that I have to reconsult all the sources in order to confirm the source playing order.
    Anyway thanks again. At least I know that it is not just me
    alanfromthatcham

  • Can not read Chinese data when DB Connect to SQL server 2000

    Hi,
       Our BW server( BW3.5 not unicode ) is installed on MS SQL server 2000. We try to connect the BW SQL server with db connect function. We create some test views in the Northwind DB. We are be able to access data from source system in rsa1 by db connect. The problem is that all the Chinese characters are displayed as ?????. Is there any special setting for accessing multibyte characters in MS SQL server 2000? Please advise.
    Thank you,
    Jeff

    The field of VIEW in the sqlserver which code is chinese must be the nvarchar.
    You can try it.

  • How can I get a filename without the file extension?

    I using a JFileChooser to select and read a file. Now I want to get the filename without the file extension
    JFileChooser j = new JFileChooser;
    String file = j.getSelectedFile.getName();
    At the moment I get this result "file.dat". I need only the filename.....
    Thank you
    Thomas

    It's quite that.
    Here is the code to do that (and the method to get only the extension):
         public String getFileName(String text) {
              int ind = text.lastIndexOf(".");
              if(0<ind && ind<(text.length()-1)) {
                   return text.substring(0, ind);
              return(null);
         public String getFileExtension(String text) {
              int ind = text.lastIndexOf(".");
              if(0<ind && ind<(text.length()-1)) {
                   return text.substring(ind+1).toLowerCase();
              return(null);
         }(I used 0<ind instead of ind>0 because with the code formatting there is a bug with > )
    I hope this helps,
    Denis

  • How can I get my data on my homepage from Firefox 3.6 to 4.0?

    I downloaded the update to Firefox 4.0 and now much of my data does not show up on my homepage, e.g. My stock portfolio is completely missing and when I press "Menu" to make changes or refresh it doesn't work at all. This is also true on all places where there is a "Menu" button.
    How can I correct this situation?
    Thanks, Jim Smothers

    Clear the cache and the cookies from sites that cause problems.
    * "Clear the Cache": Firefox > Preferences > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Firefox > Preferences > Privacy > Cookies: "Show Cookies"
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • How can I move an email without deleting it from iCloud server?

    I have local rules on my Mac to move emails from certain people into their own local folders, and sound a unique alert.  The problem is that it appears that moving it causes it to be deleted from iCloud's IMAP server, and therefore not delivered to my iOS devices.
    When I changed the rule to copy rather than move, I'm left (of course) with duplicate emails in the local Inbox folder.
    I tried creating iCloud Mail folders and using iCloud Mail rules to move certain emails into those folders.  The problem is that I can't sound the alert: it appears that Mac Mail rules only apply to mail coming directly into the Inbox.  (Also, only iCloud Inbox items get 'pushed' -- the mail in my John folder can only be retrieved when Mac Mail polls every N minutes.)
    I'm new to IMAP, so I may have missed the solution.  Can anyone suggest how, using iCloud Mail, I can:
    See the same email in my Mac and all my iOS devices
    Automatically route certain email to special folders and sound an alert, at least on the Mac
    Thanks-
    Chap

    Double tap the home button. THe app icons will line up along the bottom of the screen. Scroll sideways to find hte one you want, hold your finger down on it until you see a little minus in a red circle. Tap on that then single tap the home button to exit the mode. You've just force closed the app.

  • Error happened during the migration from sql server 2000 to oracle 8.1.7

    /*[SPCONV-ERR(18)]:CREATE TABLE TT_CHANP1 statement passed to ddl file*/
    DELETE FROM TT_CHANP1;
    error as above.
    note:
    chanp1 is a temporary table under sql 2000
    syntax:
    create table #chanp1 (chanpid varchar(50))
    we try the codes:
    CREATE TEMP TABLE chanp1
    Error: PLS-00103: "CREATE"
    begin declare end exception
    exit for goto if loop mod null pragma raise return select update while
    <an identifier><a double-quoted delimited-identifier>
    <a bind variable><<close current delete fetch lock insert open
    roll back save point set sql execute commit for all
    <a single-quoted SQL string>
    Line: 63
    we try " CREATE GLOBAL TEMPORARY TABLE chanp1" again.
    but error .

    it seems like you are trying to perform a DDL from within the PL/SQL code, which is not allowed directly.
    You could use EXECUTE IMMEDIATE within your pl/sql code to perform a DDL statement.

  • I lost my iPhone device, how can I get my data back on another one without using an iCloud backup just back up on i Tunes, Please Help.

    I lost my iPhone device, how can I get my data back on another one without using an iCloud backup just back up on i Tunes, Please Help.??

    You can find the backup files and then copy them to a safe place if you are worrying about this.
    iTunes places the backup files in these places:
    Mac: ~/Library/Application Support/MobileSync/Backup/
    The "~" represents your Home folder. If you don't see Library in your Home folder, hold Option and click the Go menu.
    Windows Vista, Windows 7, and Windows 8: \Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
    To quickly access the AppData folder, click Start. In the search bar, type %appdata%, then press Return.
    Windows XP: \Documents and Settings\(username)\Application Data\Apple Computer\MobileSync\Backup\
    To quickly access the Application Data folder, click Start, then choose Run. In the search bar, type %appdata%, then click OK.

  • In disk utility, it shows that my external hard drive is somehow unmounted and I can't access it in finder or repair it in Disk Utility. How can I get this working without losing my important data?

    In disk utility, it shows that my external hard drive is somehow unmounted and I can't access it in finder or repair it in Disk Utility. How can I get this working without losing my important data?
    Thank you!

    When you erased the disk did you select Mac OS Extended Journaled as the format option?

  • HT4993 I have a disabled iphone i forgot my passcode, how can i get it unlocked without loosing my data?

    I have a disabled iphone i forgot my passcode, how can i get it unlocked without loosing my data?

    As the manual says, you will have to restore your iphone.

  • My battery died and then when i charged the phone it is asking me to connect to itunes and restore. if i restore how can i get my data back

    My iphone battery died and on charging the phone it asked me to connect to itunes and restore the phone.
    If i restore the phone how can i get my data back and how can i check when i last backed up my phone

    If you have been syncing regularly as the iphone is designed, then you can sync the data back.
    Regardless you will have to restore the iphone.

  • HT1727 i bought some ringtones on my iPhone, later on i sync my iphone to my old computer now i have a new mac pro desktop and i only have 2 ringtones on my phone but not the rest of them how can i get them back without having to pay for them again?

    i bought some ringtones on my iPhone, later on i sync my iphone to my old computer now i have a new mac pro desktop and i only have 2 ringtones on my phone but not the rest of them how can i get them back without having to pay for them again?

    If you bought them on your iPad then you will need to connect your iPad to your computer's iTunes and do File > Devices > Transfer Purchases to copy them over to the Tones part of your computer's iTunes library and you can then sync them to your iPhone - ringtones are a one-time only download, so you won't be able to redownload them directly on your phone.

  • How can I get a date picker or wheel to show up in the form to make filling in a form with a lot of

    how can I get a date picker or wheel to show up in the form to make filling in a form with a lot of dates more easy?

    There is no built-in date picker available for forms created in Acrobat. There are some third-party solutions involving JavaScript (either a large collection of fields or a custom dialog) though. Also, text fields with date formatting will use a wheel type date picker on Android/iOS devices with Adobe Reader.

  • HT1420 I purchased and downloaded and album of ten songs. most of the songs cut out after several seconds. How can I get them again without having to re-purchase???

    I purchased and downloaded and album of ten songs. most of the songs cut out after several seconds. How can I get them again without having to re-purchase???

    Delete the problem song(s) from library including file(s). Then go to the iTunes Store and select "Purchased" from the Quick Links side bar on the right. Select Music tab to re-download again for free.

  • My charger is stuck in USB port of my car , how can I get it out without damaging either ?

    The charger that came with my iPhone 5c is now stuck in the USB port of my car. How can I get it out without damaging either?

    Use this article: If you can't update or restore your iOS device - Apple Support
    Best of luck!  And since you didn't back up your data previously, all your data is lost.  Make sure to use the free backup services of iCloud or iTunes.
    iOS: How to back up and restore your content - Support - Apple - http://support.apple.com/kb/HT1766

Maybe you are looking for

  • How do I obtain the names of graphic layers from a PDF?

    I want to write an applescript that will extact the layer names from a PDF imported into InDesign. However, the only layer name it returns is the separator layer "Test.indd" and not the actual layers contained in the PDF. The PDFs are saved from AI t

  • Opening applications externally in luakit via vimperatoresque "follow"

    Hey guys, I wanted a lightweight browser and after trying many (midori, xombrero, qupzilla, jumanji, dillo), I settled on luakit (+ privoxy). I use my keyboard for most tasks, so it's no surprise that my loyalties are towards awesome and, henceforth,

  • Import java.util.Formatter - cannot resolve symbol

    I use j2sdk1.4.2_04 when I try to compile my program using Formatter, it response error "cannot resolve symbol" Pls help!

  • Proper representation of digital IO

    When programming a digital IO board, I'm using a 2-D array of booleans to represent the state of the digital IO.  When I expand the array, it's easy to see the states of all the outputs, with one major exception. LabView array expansion/representatio

  • Photoshop and dreamweaver help

    Hello, I am fairly new to website design and do not know coding at all, but am relatively good with photoshop so i designed my website by creating photoshop pages, and then slicing them, saving as web devices, and inserting into dreamweaver where I u