Best way to store data obtained from a resultset !?

Hi all,
I am working on a verification process that is to be run on our DB upon every external db extraction prior to merge into our DB (which is being done manually now)
What I have decided so far is to have a verifier interface that is implemented by a bunch of *Verifier classes.
Then depending on the level of verification, a subset of these verifiers would run and populate a generic result object (per verifier) with the query results and whether the verifier passed or not.
I was thinking of having the Result class employ a JTable to store the query result (from a resultset), but I can't seem to find a way to retrieve the data from the Jtable row by row (I'd like to obtain the result from the JTable row by row as it would be easy to format) or the entire table to display for that matter.
Please advise if you think this is a good approach? and if JTable's a good idea!? if yes, how should i use it? otherwise, what would you suggest?
Thanks a lot,
Cheers,
parachuter2b

BigDaddyLoveHandles wrote:
There's no need for a "table". Use a List<YourBusinessClass>. If you don't know collections take the tutorial:
|http://java.sun.com/docs/books/tutorial/collections/index.html]Thanks, that's what I sort of did:
I figured how to use the ResultSetMetaData to get the column names and therefore generate a report from any query by having its resultset.
so created a Result class, which holds the resultset of the query, plus a boolean that indicates whether the verification passed or not.
Now what I have problem with is formatting the resultset and displaying it nicely in a report. The problem is that the length of the values in the resultset are variable and using constant indentation doesn't work. What's the easiest way to get around this apart from going through the resultset once before displaying the report to calculate the indentations for every single item?
Thanks,
parachuter2b

Similar Messages

  • Best way to store data from a plot on hard drive

    I have a DAQ set-up that will be on 24/7 for several days, and the whole time it's streaming data to an XY-Graph with a limited buffer.  My question is, what's the best way to store my plot data in such a way that I can empty out my plot every few hours but if I want to pull up data from a few hours ago I would just have an option on my initial VI to view any old saved plot data.
    Basically, I'm trying to not overload my RAM with all my plot data so I'd like to save it to the hard drive while my VI is running, and only display, for example the last 8 hours worth of data... I've been looking at TDMS, but I'm not sure if that's the right solution.  
    much thanks!

    Hi,
    You could save your data using TDMS as well as ASCII to simply load it in another application later.
    Attached VI shows you how to save your data to a File after a certain amount of iterations, you can combine this then with your code and a timestamp.
    Christian
    Attachments:
    Save to new file every N samples.vi ‏20 KB

  • 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

  • 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.

  • Best way to import data only from sql server 2k to ora9.2

    I have a situation where I don't care about indexes, procedures. The DDLs from sql server 2k and ora9.2
    are (mostly) teh same, I need to port the data from sqlserver to my ora database.
    what is the best way to do it?
    thanks.

    Hello Zack,
    The Oracle Migration Workbench can help you to migrate your data from your Oracle 9.2 database to SQL Server 2000. Please refer to Chapter 6, 'Migrating the Database' in the Oracle Migration Workbench User's Guide for more information about how to migrate your data using the Oracle Migration Workbench.
    You can find this document at the following location on the Oracle Technology Network (OTN) Web site:
    http://download.oracle.com/docs/html/B15857_01/migrate_db.htm#sthref282
    I hope this helps.
    Regards,
    Jocelyn (Oracle Migration Workbench Team)

  • Best way to store data server side

    Our APEX (v3.1) applications use quite a bit of stored procedures to implement the business logic. What do you think is the best way to maintain some complex state on the server (where complex is anything more than a string)?
    Ideally I would like to store this pl/sql object (say "table of integer index by pls_integer") in a package variable, but I suppose that connection pooling would make that impossible. I am aware of apex_util.set_session_state() but that lets me store only varchars.
    Should I have to come up with my own serialization / deserialization methods in pl/sql to convert maps into strings? Seems pretty weak ...
    Thanks for sharing your (I'm sure) valuable insights.
    G.

    Actually quite the contrary. You would think connection pooling would not allow you to do this, but every time your package is initialized, the package state is reset. It calls dbms_session.reset_package, so you can use global variables and not have to worry about another user pulling your values.
    You can test it to confirm, but basically when you hit a page, the first time your package is called modplsql resets the session state. So you can set global variables in Process #1 after submit and use them in Process #5, but once your page is done, the next person to grab the connection will have the package reset using the same logic.

  • Best way to store data

    Hi,
    i need to read some data in my application. Now this data are stored in a mysql db and are about 6000 rows. In another application that i've developed I used the sqlcipher library but I want to know if there is another way to storing data. This data will be absolutely crypted.
    thank you

    hi etS23 & welcome.
    You should perhaps investigate using Apple's CoreData as covered here:
    http://developer.apple.com/iphone/library/referencelibrary/GettingStarted/Gettin gStartedWithCoreData/index.html

  • 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

  • Can you suggest a best way to store and read arabic from oracle database?

    Hi ,
    can you suggest a best way to store and read arabic from oracle database?
    My oracle database is Oracle Database 10g Release 10.1.0.5.0 - 64bit Production on unix HP-UX ia64.
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CHARACTERSET WE8ISO8859P1
    I have presently stored the data in nvarchar2 field. But i am not able to display it correctly.

    Using the national characterset should work but there are other factors that you have to consider when working with NCHAR/NVARCHAR2/NCLOB.
    If possible, changing the characterset is usually the best solution if it's a possiblity for you.
    For more info:
    Dear Gurus: Can u pls explain the difference between VARCHAR2 & NVARCHAR2??

  • Best way to store movies from iTunes

    I have several movies I purchased from iTunes on my computer. Now I want to free up some space on my hard drive. What is the best way to store them off my computer so I can access them again in the future?

    I believe you can do Back up to Disc and burn them as Data Discs. (Be sure to check your burning preferences first.) You won't be able to view them from the burned discs, but you can use them to restore to your library. Burning the movie itself....I doubt you can get it to fit on one CD. Another option would be to invest in an external drive. I hear they're pretty affordable.

  • 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

  • How is the best way to read data from an iphone if you lost your itunes data after a crash?

    How is the best way to read data from an iphone if you lost your itunes data after a crash?

    How is the best way to read data from an iphone if you lost your itunes data after a crash?

  • Best way to import data to multiple tables in oracle d.b from sql server

    HI All am newbie to Oracle,
    What is the Best way to import data to multiple tables in Oracle Data base from sql server?
    1)linked server?
    2)ssis ?
    If possible share me the query to done this task using Linked server?
    Regards,
    KoteRavindra.

    check:
    http://www.mssqltips.com/sqlservertip/2011/export-sql-server-data-to-oracle-using-ssis/
          koteravindra     
    Handle:      koteravindra 
    Status Level:      Newbie
    Registered:      Jan 9, 2013
    Total Posts:      4
    Total Questions:      3 (3 unresolved)
    why so many unresolved questions? Remember to close your threads marking them as answered.

  • What could be the best way to Export data from 11.5.8 instance to 12.1.2?

    Hi All
    What could be the best way to Export data from 11.5.8 instance to 12.1.2?
    Release: 11.5.8
    OS: Oracle Solaris on SPARC (32-bit) verison 9
    DB: 9.2.0.1
    Thanks in advance

    What kind of data you are looking to move?
    Database export/import is only supported for full database export/import and the application release should be the same on the source/target nodes.
    You can move the setup using iSetup or FNDLOAD.
    Thanks,
    Hussein

  • 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

Maybe you are looking for

  • Few basic questions about sharing and other stuff..

    Hi there! First of all I know where are "101" pages, but they are not giving detail information. 1.I know there are some folders where I can put files, web-sites and other in order to enable sharing. What do I have to do to enable other users (from i

  • Function Modul for generate hashcode

    Hi all i search a function modul for generate a hashcode. Does it existing a function modul for that? Regards

  • Recommendations from SPARCers

    Are there any recommendations from SPARCers about how to live with a non-updated Adobe Reader?  I can turn off javascript and the opening of non-pdf attachments in Adobe Reader, but I'm not protected against any new vulnerabilities which might come o

  • [SOLVED] Low quality windows after kernel upgrading

    Hello, I've got such a weird situation. After I upgraded to 3.12-2, my KDE windows got a low quality style. You can figure out better what I mean with this screenshot. I did try to reinstall the video driver (I'm using the integrated gpu currently),

  • Can not find User's Manual for Lenovo T420

    Hi ,   I just bought T420 but unable to find User's Manual. The instructions says, For the Windows 7 Operation system: Click Start and then click Help and Support.  The Windows Help and Support window opens. Click Lenove user Guide in the Lenovo User