What is the best way to store data for this project?

hey everyone,
I have been subscribed to this for a while, not sure if I have ever actually asked anything though.
I have a project on the go for myself/portfolio
It is a booking sheet, where by I have a GUI that has a diary system of a day followed by time slots. This also has a date picker that can change the date of the booking sheet
I want to be able to store mainly strings and ints,
I need to be able to store, retrieve and on occasion change some data.
I was looking at using something called JExcelAPI but I cant get that to work at all, I asked for assistance but was refered to here.
what would be the best way to implement this data storage?
davyk

Hey everyone,
Back again,
I got this this little snippet of code working but want to ask you guys for a little bit of help on it. if thats ok?
try
     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
     String dataSourceName = "mdbTEST";
     String dbURL = "jdbc:odbc:" + dataSourceName;
     Connection con = DriverManager.getConnection(dbURL, "","");
     // try and create a java.sql.Statement so we can run queries
     Statement s = con.createStatement();
     s.execute("create table TEST1234567 ( column_1 char(27), column_2 char(150), column_3 char(150), column_4 char(150), column_5 char(150), column_6 char(150))"); // create a table
     s.execute("insert into TEST1234567 values('"+date+"','"+a+"','"+b+"','"+c+"','"+d+"','"+e+"',)"); // insert some data into the table
     s.execute("select column_7 from TEST1234567"); // select the data from the table
     ResultSet rs = s.getResultSet(); // get any ResultSet that came from our query
     if (rs != null) // if rs == null, then there is no ResultSet to view
                while ( rs.next() ) // this will step through our data row-by-row
          /* the next line will get the first column in our current row's ResultSet
          as a String ( getString( columnNumber) ) and output it to the screen */
               System.out.println("Data from column_2: " + rs.getString(1) );
     s.execute("drop table TEST1234567");
     s.close(); // close the Statement to let the database know we're done with it
     con.close(); // close the Connection to let the database know we're done with it
catch (Exception err)
     System.out.println("ERROR: " + err);
     err.printStackTrace();
}there are more columns, but i cut this code down.
my question is:
I think I want a method with an if statement to see whether the table is created or not, if not create it, but how do I go about this? I have searched the API and google, but my brain is fried.
Also do I always have to do the try/catch and have the code of Class.forname to Statement s in all methods that want to deal with the table?
davy

Similar Messages

  • What is the best camera technique to use for this project?

    hi, im making a small thing for my gf on motion. i have it so that certain text appears along with pictures. i want the camera to pause momentarily to read what it says and then begin moving to the next set of text/pictures, then stop there for a little while too, then go on to the next one, etc etc.
    whats the best way to do this? the pictures/text are NOT in a straight line so making the camera go straight through wont work. one might be directly in front of the camera then i will have made the next set to be directly downward so i want the camera to swoop down there and pause on them, then the next set might be straight up all the way at the top etc. how can i get the camera to move then pause, move then pause over and over where i want it to until the project is over?
    sorry if this is a noob question but i have no idea
    thanks!!

    What version of the studio are you using?
    In Motion 3 you could try keyframing the camera move , the zoom layer behavior, or Move behavior.
    If you've got Motion 4, try the Camera Framing Behavior.
    There are several ways to accomplish what you want to do, it really comes down to what you are most comfortable with.

  • What is the best way to store data to a file? Serialization?

    FYI: I am some what of a novice programer. I have almost finished my degree but everything I know about Java is self taught (never taken a course in java). Any way here is my question.
    So I have an example program that I have created. It basically just has three textpanes which also have the ability to contain images. Now I would like to learn how to store data to a file for later retrieval and decided to use a program such as this as an example. I am not sure if I should use the serialization API that java has or some other means such as XML. If I used XML I was not sure how to store the image data that would be contained in the text panes. I figured serialization would take care of that if I just serialized my main class and then restored it. So That is that I tried first. Is this a good direction to go?
    The problem I am having is that I cant seem to get the serialization to work the way I need it to. I am not sure what I am doing wrong because I have read many tutorials and looked at allot of example code but still dont understand. The tutorial I looked at most is [this one at IBM.|http://java.sun.com/developer/technicalArticles/Programming/serialization/]
    The eclipse project folder for my example program can be found here:
    [http://startoftext.com/stuff/myMenuExp/]
    zipped version:
    [http://startoftext.com/stuff/myMenuExp.zip]
    The main class is mainwindow.java. I know the source is kinda dirty. Any comments are welcome but I am most interested in how to solve this serialization problem. Thanks
    -James

    DrClap wrote:
    What will the nature of the data be? Just a handful of strings? A bunch of objects of different types reflecting the current state of your program to great depth and complexity? Something else?The data will be what is contained in three text panes. Each text pane containing rich text and images. For an example take a look at the example program in my first post.
    How will the data be used? Just write it out when the app shuts down, and read it all back in when it starts up? Do you need to query or search for specific subsets of the data? Is there any value in the stored form of the data being human-readable?Basically the data will need to be saved when the application shuts down or when the user selects save from the file menu. The data will be restored when the user opens the file from the file menu. It would be nice if the stored data is human readable but its not of primary importance.
    How often will the data be written and read? How many reads/writes/bytes/etc. per second/minute? Not often. Just a simple open and save from the file menu.
    How large could the data conceivably get?It will probably be a few paragraphs of formated text and less then a dozen images per text pane.
    Will reading and writing of the data need to occur concurrently?no.
    Do you need to add new data to the storage as your app goes along, or just replace what's there with the most current state?Replace with the most current state of the data.
    If it's a simple read once at startup, write once at shutdown, overwriting the previous data, read only by your app, not by humans, then serialization via ObjectInput/OutputStream is probably the way to go. If there are other requirements, you may want to go with XML serialization, a DB, or some other solution.Thanks for the information. Serialization sounds like the way to go. Even if I end up using XML serialization in the end it would still be of interest to me to learn how to use serialization without xml.
    I was trying to go with using serialization in be beginning but I cant seem to get it to work. Would you be willing to take a look at my example program. I attempted to implement serialization but it does not seem to work. Could you take a look and see what I am doing wrong. At this point I am stuck as i cant seem to get serialization to work.
    I am going to go ahead and mark this thread as answered because I think I already got most of the information I was looking for except what I am doing wrong with my attempt as serialization.
    Thank you jverd for your time.

  • What is the best way to store data on a network hard drive using CompactRIO RTOS and Labvew Real time?

    HI!
    I'm starting a project in which I have a low rate stream of data to read in a real time environment. I should store these data on a network hard disk without any PC with standard OS, I just have CompactRIO RTOS. How can I send this data to the network drive? Is it possible to just “write” data like I do for a standard file in LabView?
    Thanks for any help!!
    Il Conte
    dr. Valentino Tontodonato

    Il Conte,
    you have to keep in mind that normally the RT OS does not map drives other than the Compact Flash that it has onboard (C:\). There are exceptions such as
    -cFP-20xx which may have additional Flash Drives which can be addressed as D:\ Drive
    -CVS systems with IEEE-1394 interface can write/read to Firewire external Harddrives
    -PXI Controllers booted from a Floppy disk may map the floppy drive as A:\
    One solution to your needings may be to write data to files locally on your onboard CompactFlash and then transfer these files to a network location using FTP, provided the network drive you are pointing to supports FTP.
    Let us know if you need any more help with this,
    AlessioD
    National Instruments

  • HT204266 Hi, what is the best way to find Apps for certain projects i need? i am looking for an App that hold files for projects that i look after?

    I am looking for a App that i can store projetcs in, and use on site when i need to show a client! i need it to show notes pdf drawings ect? how do i search this?
    Thanks
    Mike

    I am looking for a App that i can store projetcs in, and use on site when i need to show a client! i need it to show notes pdf drawings ect? how do i search this?
    Thanks
    Mike

  • What is the best way to store and search 2D data

    Hi,
    There is a set of data (~10k records ) in 2D dimension.
    like this :
    Col 1, Col 2, Col3....
    What is the best way to store and search those records ?
    Thanks in advance
    Wilson

    Hi,
    Either userObjet[][] if you know how much data you have, and the data size is fixed, or use a list of lists. E.g. A Vector of Vectors (some will probably say that you should use an ArrayList instead, and that could be the case, but it sounds like you would want to display the data later on, and a DefaultTableModel (for JTables) uses a Vector as data holder).
    Kaj

  • What is the best way to transfer data from a PC to an iMac?

    What is the best way to transfer data from a PC to an iMac?

    If you know how to set up a computer-to-computer Ethernet network, then you can give that a try, but a hard drive will be faster than Ethernet unless you don't have a lot to transfer.
    Mac OS X 10.6 Help- Creating a computer-to-computer network

  • What is the best way to store a battery?

    Hi,
    I have an extra MBP battery. What is the best way to store this extra battery? Should I store it when it is fully charged? or Should I store it when it is half full? Is it necessary to use that batter once in a while?
    Thank you beforehand.
    Bob

    http://www.apple.com/batteries/notebooks.html
    If you're storing it for a long time, put it away when it's about half full. If you have a couple of batteries for your MacBook, I'd recommend swapping batteries once a month or so to extend the life of both batteries.

  • How do you move pictures to an external drive to open space on the Mac hard drive? Or what is the best way to store photos safely?

    How do you move pictures to an external drive to open harddrive space? Or what is the best way to store large photo files? Ive tried copy/cut and paste and it doesnt work. I have nothing on my Mac but photos and its telling me startup disk is too full to download updates.

    Are the photos being stored in iPhoto now?
    How is the external disk formatted?
    Allan

  • Should the admin/user folder and all of its sub folders be moved to the hdd or just parts of it? (eg. picture, movies, documents)  What is the best way to go about doing this.  Also should a 2t hdd be partitioned.

    iMac with 256ssd and 2t hdd. Should the admin/user folder and all of its sub folders be moved to the hdd or just parts of it? (eg. picture, movies, documents)  What is the best way to go about doing this.  Also should a 2t hdd be partitioned.

    Yes, you can move your user directories to the HD and keep your OSX and Applications on the SSD drive.
    Whether you partition your HD or not depends on how much data you have and how you propose to use your HD.
    Are you planning to use your iMac as a Time Machine backup volume? If so, partition it off.
    Do you have huge data files, eg video, music, photos?
    How much of your 2tb drive will be "free" once it is loaded with all your data?
    A little more information is required before the optimal configuration can be recommended for your use.

  • What is the best way to format Videos for ipod touch?

    What is the best way to format Videos for ipod touch? Used Quicktime Pro/ Export (iPhone setting). Videos aren't as crisp as downloaded Videos. Compressors /ipod video Setting also looks crapy (with bitrate med & High). What should I use?

    Visualhub is a transcoder with multiple input and output formats with specific setting for iPod,iPod touch. Costs around $19-used to work great but recently everything I convert suffers audio crash than closes out the player. Hopefully they will fix it.
    Elgato H.264 hardware transcoder is $99 dollars(USB stick that plugs in to Mac)-speeds up encoding of any file quicktime can handle, settings for apple tv, iphone/touch, ipod,Sony PSP. Worth the cost if you transcode a lot of video for the Touch or own an elgato HD tuner. Files work flawlessly and look great.
    Mpeg streamclip-free. Works great, has presets or can customize the output.

  • What is the best way to create space for a Yosemite download?

    What are the best ways to create space for the download of Yosemite.  I can't install it as I don't have enough space.

    Did you empty Trash?  Very important!
    How much space do you have available?  Click in the HDD icon on the desktop, COMMAND+I.
    Also try a Safe Boot:
    http://support.apple.com/kb/HT1564?viewlocale=en_US
    That will temporarily create some additional space.
    Ciao.

  • HT5621 My husband and I both have iPhone 5. We currently share the same apple I'd. How do we get separate ones. Him keeping his and me getting a new one? What is the best way to go about doing this?

    My husband and I both have iPhone 5. We currently share the same apple I'd. How do we get separate ones. Him keeping his and me getting a new one? What is the best way to go about doing this?

    FAQ apple id http://support.apple.com/kb/HT5622?viewlocale=en_US

  • What's the best way to store my info externally

    I have recently bought my first Macbook Pro 13" with 2.4 Ghz. I am currently using it for my own business and do tend to get a lot of files together. I went to look at "About this Mac" and have already got 369 Gb used up in storage... I have no idea how I have done that as I have hardly downloaded any apps on this computer besides the ones that were on here. I did download Vware Fusion 4 as I have a reservation system which I used to run on my pc and need to have this on here too so perhaps that software takes a lot of space.
    Could anyone advise on which is the best way to store my info externally, will any external harddrive do, or do you need a special one for Apple or Macbook pro. I am just asking as I have no idea and prefer to buy the right one straight away.
    Any help would be much appreciated !
    Thanks, Sara***

    Sara,
    The most reliable method is to use an external hard drive.  Some are better than others, but most will work.
    For the least amount of setup pain, I prefer to deal with the Mac specialists at OWC, http://www.macsales.com as they stand behind their products with great warranty and support.  I have one of their Mercury Elite Pro 2 TB drives that has multiple interface capability so you can get a fast interface for data transfer.
    Take a look at what they offer and see what fits your needs.  If you have more questions about doing thin, just ask on here.
    Ralph

  • What is the best way to retrive data from a Global Variable?

    Here is what I want to do,
    I have several PC's that run different types of tests. I want to use a global variable, running on a single PC, that acts like a sever that can be accessed by the other PC's in my lab. This Global variable will store the hostnames of the different PC's that are currently running each test, along with a description of the test.  Then, a user can access this Global variable to read the different values and select the PC and connect to it's desktop using Remote Desktop in Windows.
    Is it possible to write data to the Global variable that is running on the single PC?
    What is the best way to do this? Does anyone have a sample VI?
    What is the best way to then read the data from the Global variable?
    (I will probably use an array\cluster to store the hostnames.) 

    Another pre-LV8 idea...
    A functional global can be accessed using VI-Server and called using "call by reference".
    This approach harnesses the TCP functionality built into the VI-Server to manage the conncetion.
    This can be pretty quick and (if the functional global is written correctly) will support buffered- mixed data types. (Try to do that with the Shared Variable  ).
    Just another idea,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for

  • Windows 8.1 deployment and the store

    Hi all. I'm in the process of creating a Windows 8.1 image and I'm trying to understand how the Windows store works within the enterprise, does anyone know how the process should work in terms of... Can a domain joined Windows 8.1 device open the Win

  • Hard drive and hub with Time Capsule

    I want to add a hard drive to my Time Capsule 2TB. I've read the other posts here, but am still feeling uncertain about how to be successful. I have a printer connected, and want to keep it connected, so I know I need a hub. I have a USB-powered hard

  • S10-3 Wireless - not working with Windows 7

    Hi, I bought the S10-3 two days ago and decided to load windows 7 (ultimate). The load was smooth but after I had finished the wireless was not working nut the wireless light on the front of the PC was on. The first strange thing I noticed was Fn5 di

  • Nokia Music download is not showing up in the musi...

    Nokia 920 I purchased a song via the Nokia Music app and I have noticed that even after restarting my phone the song does not show up in either the Nokia Music or music + videos app for me to play it. If i attempt to purchase the song again, i get a

  • Relinking Forms executable in Oracle 11i

    Hi Friends, I am facing an issue where after i starts the forms server using adfrmctl.sh, it works fine for a few hours after which i receive an FRM-92050 error in forms application. I have to restart the forms server again to get it back working and