Serialization vs SQL vs saving as text

hello, I am at a standstill in my programming...I am writting a Meeting Reservation program and I am unsure about whether I sould use SQL or some form of database to organize the data for each meeting. The information that I am keepiong track of for each meeting includes the room, date, start and end time, Meeting name, contact name and number, and special equipment.
The main function of this program is to schedule meetings, and allow for easy daily print outs of the meetings for each day. Only rarely is it necisary to look up the time for a meeting by anything other than the date of the meeting. Would a database for this be more trouble to write than it is worth for this type of program. I have no experience with using databases in java.

I would definately recomend using a database. I have seen many applications like this start out as small, simple things and then grow over time to encompass more functionality. If they start out using flat files, growing to handle more data or more complex data schemes often turns into a nightmare.
Using JDBC is fairly easy and a database is hardly ever more trouble than it's worth (updating a flat file in the middle is a horrible nightmare).
Here is a simple JDBC program to read some data from a database.
import java.sql.*;
public class SimpleDBTest {
  public static void main(String args[]) {
    Connection conn = null;
    PreparedStatement sql = null;
    ResultSet res = null;
    try {
      DriverManager.registerDriver((Driver) Class.forName(args[0]).newInstance());  //Register the DB driver passed as command line arg
      conn = DriverManager.getConnection(args[1],args[2],args[3]); //Pass connection data, user name and password
      sql = conn.prepareStatement("select foo from bar");
      res = sql.executeQuery();
      while (res.next()) {
        System.out.println(res.getString("foo"));
    catch (IndexOutOfBoundsException e) {
      System.err.println("Usage: SimpleDBTest dbDriver dbURL dbUSer dbPassword");
    catch (SQLException e) {
      e.printStackTrace(System.err);
    finally {
      try { res.close(); } catch (Exception e) { }
      try { sql.close(); } catch (Exception e) { }
      try { conn.close(); } catch (Exception e) { }
}java SimpleDBTest oracle.jdbc.driver.OracleDriver jdbc:oracle:thin@hostname:1526:dbInstance userName password

Similar Messages

  • How to load SQL scripts from a text file.

    Hi, i tried several time to load a text file/SQL script with 10 different tables and data, but 10g Express doesen't allows me to do that, any one can direct me or point out to me what i should do or do i need to adopt any special method to to get this done. i am sure there must be some thing where you can upload SQL scripts from a text file (in SQL command editor!). thanks

    Hi,
    see my other answer here:
    SQL command editor doesn't take more than 1 insert command
    This seems to be a duplicate question, right? Or am I missing something?
    Regards,
    ~Dietmar.

  • Error while saving Long Texts

    Hello
    We are using SRM7 Extended classic scenario.
    We don't use shopping carts, rather create POs directly in SRM which will be transferred to ECC as per the standard.
    Error:
    I am getting an error "Error while saving Long Texts" during my PO creation. I get this message in a small pop-up screen. As soon as i click ok or close the pop up screen it kicks me out of the PO creation screen back into the main SRM screen.
    When:
    During the PO Creation
    Any specific situation:
    Yes, only for Material POs
    This is happening when I am creating the PO with a Material code. I can create free text PO without any issues.
    This is a standard message and the message number is 022.
    Thaks for the help guys.

    Hi,
    To confirm can you check commeting "getOADBTransaction().commit();" gives any error message?
    If yes then you can try the following option:
    Have you checked whether the "/" is changed to "\" in the dbc file?
    In the following two entries the slash has to be made as shown below:
    APPS_JDBC_URL=jdbc\:oracle\:thin\:@(DESCRIPTION\=(ADDRESS_LIST\=(LOAD_BALANCE\=YES)(FAILOVER\=YES)(ADDRESS\=(PROTOCOL\=tcp)(HOST\=10.100.503.6)(PORT\=1521)))(CONNECT_DATA\=(SERVICE_NAME\=VIS)))
    JDBC\:processEscapes=true
    Thanks and Regards,
    Lacman

  • How to display the out put of the sql query in a text file using forms

    I want to display the out put of the sql query in a text file using forms 6.0.Same could be done using spool command in sqlplus but i want it using forms....Fiaz

    Have a look at the text_io package:
    http://www.oracle.com/webapps/online-help/forms/10g/state?navSetId=_&navId=3&vtTopicFile=f1_help/oraini/c_text_io.html&vtTopicId=
    cheers

  • SQL Injection with Oracle Text

    I did a search here for any posts about SQL Injection on Oracle Text indexes, but returned no hits.
    Can anyone give their opinion about whether SQL Injection is a concern when using Oracle Text or what steps can be taken ahead of time to prevent (or at least reduce the attack surface) on Oracle Text queries.
    We're running a web app. that will use Oracle Text and our users can enter any search string as well as select pre-defined items from a drop down box.
    Thanks in advance for any opinions
    LJ

    quote:
    Originally posted by:
    Dan Bracuk
    What others can do is more relevent than what we think. When
    in doubt, test.
    very true, although my final solution went more like, "When
    in doubt, manually add about 600 cfqueryparams in 406 cfquery
    tags".

  • Error saving help text !

    What's the maxsize of a Item Helptext.
    Recieving following error when trying to add helptext larger than approx 2000 characters:
    Error saving help text for item "2863318983774284".
    Thanks Gunnar
    Message was edited by:
    ganderss

    just testing RSS freshness ;)
    sorry

  • RickTextbox - getting and saving the text to and from SQL server database

    I have no trouble saving the data to an SQL Server database.  Here is a sample of what is saved.
    {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
    \viewkind4\uc1\pard\f0\fs17 testing the\par
    rich\par
    text box\par
    when I retrieve the text from the database, I end up with exactly what is shown above.  I am retrieving the text with a SqlDataReader.  here is the code that I am using;
    while (sqlDataReader.Read())
    string special_Instructions = ""; //first I was using this line but both lines have the same result // special_Instructions = sqlDataReader["Special_Instructions"].ToString();
    special_Instructions = sqlDataReader.GetString(5);
    special_InstructionsRichTextBox.Rtf = special_Instructions;
    any guidance or help will be greatly appreciated.
    dave

    Michael,
    Lets begin with, 'Thanks for your guidance'. With your last run of questions, I was able to figure it out.
    Here is what I learned, (by the way, this is in Winforms):
    When I checked the properties of the RichTextBox control, I saw and then remembered that the control was bound to the form.  First thing I did was comment out the code I was using (above) to fill the control and tested the program.  I actually
    received the same issue with the contents of the control as before.
    I then dropped a new RichTextBox control from the tool box to my form and positioned it next to the original control.  I un commented the above code and used it to fill the new
    richTextBox1.Rtf and ran the program.  The original control that was bound to the form still gave the incorrect result but the new control worked perfectly.
    I hope this helps others and Thanks again for your guidance.  If there is anything else you think could be added to this reply please let me know.
    dave

  • Saving SQL+ output to a text file

    I have to use SQL+ on one of my databases. No way around it. So I will write my queries, run them, check the output, tweak them and run again as necessary. So I might start with
    SELECT
    ename,
    job
    FROM
    emp;Once I know it is working correctly, I wrap it in a procedure so I can get the data in a text file:
    SET TRIM ON
    SET PAGESIZE 2000
    SET SERVEROUTPUT ON SIZE unlimited
    EXEC DBMS_OUTPUT.ENABLE(null)
    SPOOL c:\mySQL\out.txt
    BEGIN
    DECLARE
    CURSOR c_cur IS
    SELECT
    ename,
    job
    FROM
    emp;
    BEGIN
    DBMS_OUTPUT.PUT_LINE(
    'NAME|JOB|'
    FOR r_cur IN c_cur LOOP
    DBMS_OUTPUT.PUT_LINE(
    r_cur.ename||'|'||
    r_cur.job
    END LOOP;
    END;
    END;
    /Then I import this into Excel as delimited data on the pipe |
    which works great until I decide that I actually do need one more column. Then I have make changes to the SQL, and two more changes in the output portion (one for the heading, and one for the LOOP)
    I was wondering if anyone had written a cool procedure that I could run ANY SQL through, and it would automatically know my column names write the headings and then loop through the data automatically.
    I'm not tied to using the exact procedure I described above. The key is, I am looking for a general procedure that I can run any script through, and it will handle the output for me, without additional modification.

    MrGibbage wrote:
    I have to use SQL+ on one of my databases. No way around it. So I will write my queries, run them, check the output, tweak them and run again as necessary. So I might start with
    SELECT
    ename,
    job
    FROM
    emp;Once I know it is working correctly, I wrap it in a procedure so I can get the data in a text file:
    SET TRIM ON
    SET PAGESIZE 2000
    SET SERVEROUTPUT ON SIZE unlimited
    EXEC DBMS_OUTPUT.ENABLE(null)
    SPOOL c:\mySQL\out.txt
    BEGIN
    DECLARE
    CURSOR c_cur IS
    SELECT
    ename,
    job
    FROM
    emp;
    BEGIN
    DBMS_OUTPUT.PUT_LINE(
    'NAME|JOB|'
    FOR r_cur IN c_cur LOOP
    DBMS_OUTPUT.PUT_LINE(
    r_cur.ename||'|'||
    r_cur.job
    END LOOP;
    END;
    END;
    /Then I import this into Excel as delimited data on the pipe |
    which works great until I decide that I actually do need one more column. Then I have make changes to the SQL, and two more changes in the output portion (one for the heading, and one for the LOOP)
    I was wondering if anyone had written a cool procedure that I could run ANY SQL through, and it would automatically know my column names write the headings and then loop through the data automatically.
    I'm not tied to using the exact procedure I described above. The key is, I am looking for a general procedure that I can run any script through, and it will handle the output for me, without additional modification.Why are you bothering with the PL/sql procedure at all? Why not just
    SET TRIM ON
    SET PAGESIZE 2000
    SPOOL c:\mySQL\out.txt
    SELECT
    ename,
    job
    FROM
    emp;
    spool off

  • SQL LIKE statement to text field fomr CF MX 6.1

    Hi.
    Here's my scenario. I am running SQL Server 2000 SP4 on a
    Windows 2003 Server running IIS 6. Using ColdFusion MX 6.1 Updater
    version.
    I am storing HTML page code (some complete, some just clips)
    in a text type field.
    I need to check to see if someone has already saved that
    exact code already before. So I do the following query:
    <cfquery name="checkforexisting"
    datasource="mydatasource">
    SELECT smallfieldtogetareturn
    FROM MyTable
    WHERE MyTextField LIKE '%#mystringoflongdata#%'
    </cfquery>
    Then to see if it posted:
    <cfif checkforexisting.RecordCount GT 0>
    do the don't clip optional processing
    </cfif>
    What is killing me is that it finds the match SOMETIMES. Just
    not ALL the time. I have tried no percent signs when passing the
    ColdFusion variable, only one on the right (which has solved these
    types of problems before).
    If I pull the record back OUT of the database in a page by
    itself (retrieving it by key field), it finds every other copy of
    the code EVERY time.
    I have put this into a stored procedure, which seemed to help
    I even have resorted to creating a temp table first with the
    clip, then running a query to retrieve the record that was just put
    in, and comparing THAT to my primary table (both have text type
    fields). The reason for this, is that if I write a single page that
    has just the retrieval of the temp record, and that compare is run,
    it finds EVERY copy of it in the primary table. I also thought that
    maybe there was a strong problem (I had tried HTMLEditFormat,
    HTMLCodeFormat, JavaCast since it was coming from a java program on
    the browser end).
    I am not terribly familiar with using large text fields, or
    dealing with these large pieces of HTML code as something to
    compare!
    - Mike

    MichaelSJudd wrote:
    As Dan indicated your most likely issue is slight differences
    in
    capitalization and|or white space or other 'invisible'
    difference
    between your strings. One can have nearly infinite variety in
    HTML code
    that will display identically in a browser, the standard is
    very
    forgiving of formatting differences.
    Something I have done in the past to compare HTML content is
    to use the
    hash() function. It will not help you eliminate the
    differences but it
    would show when something is different then it appears to be.
    #hash(mystringoflongdata)# will return a hexadecimal number
    representing
    the string. Two *exactly* the same strings will produce the
    same
    number. Then it is very easy to compare these numbers to see
    if two
    long strings are the same.
    To use this with your database data, you would probably have
    to store
    the hash value of the string in a field when you store the
    HTML data.
    HTH
    Ian

  • Use SQL to get long text

    Hi,
      Is it possible to retrieve the long text in STXH and STXL by SQL instead of READ_TEXT FM??  How can i covert the HEX text back to normal text??
    Regards,
    Kit

    Hi,
    1. Only the way to Read long text is use the function module ‘READ_TEXT’ for which u need to pass TEXTOBJECT, TEXTID, TEXTLANGUAGE AND ONEMORE(I FORGET).
    Because the STXL and STXH these tables are cluster tables in which data stored in ‘LRAW’ field which is in RAW format which u can not understand and our normal SQL can also.
    2. so u can read most of cluster tables by Function modules only.
    3. u can modify or saved by ‘save_text’

  • Apex 4.2 Report region sql query with "apex_item.text" renders wrongly

    In APEX 4.2 page i have created region "Report data".
    Type="SQl Query".
    "User Interface"-->"Template"="Reports Region".
    "Region Source"="select apex_item.text(1, '111') as c1 from dual".
    Actually the select query is little bit more complex, but generally simplified it is such, that it uses function "select apex_item.text" to construct HTML textfield.
    If i run in Sql Developer query
    select apex_item.text(1, '111') as c1 from dual;Then result is:
    <input type="text" name="f01" size="20" maxlength="2000" value="111"  />But in APEX 4.2 the report is rendered so:
    <td  headers="c1">&lt ;input type=&quot ;text&quot ; name=&quot;f01&quot; size=&quot;20&quot; maxlength=&quot;2000&quot; value=&quot;111&quot;  /&gt ;</td>(for this forum to display correctly i had to put extra spaces between" &gt" and ";" and so on)
    And APEX 4.2 shows ugly html inside report cell/slot for me, displaying characters/symbols ">". The reason is that APEX HTML page source does not have symbol ">" but has " &gt ;" .
    In APEX 3 i have similar query working well, without such anomaly.
    What attribute should i change in APEX 4.2 region to display my query result as needed?
    I need that function "apex_item.text", i cannot remove it.
    Edited by: CharlesRoos on 13.02.2013 15:28
    Edited by: CharlesRoos on 13.02.2013 15:29
    Edited by: CharlesRoos on 13.02.2013 15:29

    CharlesRoos wrote:
    In APEX 4.2 page i have created region "Report data".
    Type="SQl Query".
    "User Interface"-->"Template"="Reports Region".
    "Region Source"="select apex_item.text(1, '111') as c1 from dual".
    Actually the select query is little bit more complex, but generally simplified it is such, that it uses function "select apex_item.text" to construct HTML textfield.
    If i run in Sql Developer query
    select apex_item.text(1, '111') as c1 from dual;Then result is:
    <input type="text" name="f01" size="20" maxlength="2000" value="111"  />But in APEX 4.2 the report is rendered so:
    <td  headers="c1">&lt ;input type=&quot ;text&quot ; name="f01" size="20" maxlength="2000" value="111"  /&gt ;</td>(for this forum to display correctly i had to put extra spaces between" &gt" and ";" and so on)
    And APEX 4.2 shows ugly html inside report cell/slot for me, displaying characters/symbols ">". The reason is that APEX HTML page source does not have symbol ">" but has " &gt ;" .
    In APEX 3 i have similar query working well, without such anomaly.
    What attribute should i change in APEX 4.2 region to display my query result as needed?Ensure that the Display As Column Attribute for the C1 column is Standard Report Column.

  • Passing parameters to the SQL Report from a text box in jsp

    Hi All,
    I want to dynamically generate the SQL Server Reporting Services by passing the query parameter from the url like this :
    "http://localhost/Reports/Pages/Report.aspx?ItemPath=%2fDashboardReports%2fHorse_Profile&rs:Command=Render&rs:HorseID=117415"
    Where horseid id my parameter which is needed by report to generate the required data.
    This query paramter value is picked from the text box on my jsp page.
    But my problem is when i go to this url it says the message
    "The 'HorseID' parameter is missing a value ".
    I have done a lot of search on this topic. Everybody says that we can pass the values from the url like i am using. But still its not working.
    Any body has any idea please give me some idea.
    Regards.

    If you receive a picture via email or text message in ios 7 and when you press the action icon to save the picture and you do not get the option to save to your camera roll. Press and hold on the the image and you will get an overlay pop up to save the image. I have no idea why some attachments don't have option in action menu to save in the camera roll but by experimentation and earned frustration I found the above to work in certain situations.
    Be well and have fun and feel rewarded in your frustrations. For without challenges, life would be an utter bore.

  • How can I convert the encrypted SQL data to clear text in CCM?

    I want to retrieve CCM information from SQL database but many of them display as encrypted as follows,
    {14AE763F-D1EE-44A2-93C1-00FB95578E43} {7FD1AACD-6E85-4B79-A0D1-5F25074414D0}
    Any way to convert to clear text?
    Thanks in advance,

    I need to summarize the current CCM configuration into spreadsheet and want to reduce the labor work by manually typing. For example, the Route List display in SQL as I mentioned instead of clear text.
    Any tool available to get all the configuration information as clear text?
    Thanks,

  • Sql Server 2012:Full Text Catalog taking up all the disk space

    We have created full text catalog and index for a pretty large table. The column on which the index is being created has a datatype of varchar(max). The problem started as soon as we started populating the catalog. It almost grew to 835GB and Population
    status stuck to "Processing Notification". I think is status code 9 which corresponds with
    the "Change tracking" status in the SQL. It gets stuck in this status almost for ever.
    Is there a way to deal with this huge catalog size, may be shrink it or move it to a different location. 
    Is switching off Change Tracking going to improve the situation.
    Any help regarding this will be highly appreciated.
    Thanks,
    Saikat

    Hello,
    There could be considerable amount of indexes on that catalog and the effect of the merge over them. Try the index size property of
    the following function:
    http://msdn.microsoft.com/en-US/library/ms190370(v=sql.110).aspx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Problem with data saving into text file

    Hi,
    The problem I am facing wihile saving the data into text file is that everytime when I am slecting the path from front panel, the data which is being saved is appended with the previous data, i.e. not only in the new text file, the new set of data is saved but also, if there is any previuos run for the program, the corresponding data is also present in that text file.
    However, when I change the same 'control'(file path) to 'constant' in the block diagram, and add the file path, there is no such problem. Basically, changing the "File path" from constant in the block diagram to control (so that it is displayed in the front panel) is causing the problem.
    Please help!
    Thanks 
    Solved!
    Go to Solution.
    Attachments:
    front panel.JPG ‏222 KB
    Block Diagram.JPG ‏70 KB
    Block diagram with File Path as Constant.JPG ‏74 KB

    Your shift register on the For loop is not initialized. It will retain the value of the string from the last time it executed. Initialize that and it should solve your problem.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

Maybe you are looking for

  • ITunes 9 no longer supports iPod to sync playlists made with podcast files

    With the last iTunes upgrade my iPod can't recognize those playlists I had previously created with podcasts files downloaded using iTunes. They just have disappeared from the list in the section Playlists of my old iPod 5G. The same occurs with a new

  • Expanding Raid 5 array (with windows 2003)

    I recently put 2 more 500GB drives into my existing 4 drive Raid 5 setup. I went through the expansion through RAID ADMIN 1.5. It synced the array which took about a day and inside the RAID ADMIN 1.5 tool it says the array is now 2.27 TB. Inside wind

  • Hp hdx 16t laptop, hooked it philips 52 tv via hdmi cable and get video but no audio

    Hp HDX 16t laptop Windows vista home prem, 64 bit, 4 gig ram, (512) 9600m gt nvidia geforce video card. Hi I have a hp hdx 16t laptop, hooked it up to philips 52 inch LED tv via an  hdmi cable and get video on tv but no audio.  Only sound from laptop

  • How to stop iPhoto opening on all user desktops

    Whenever iPhoto is opened by one user on an iMac, the application also opens on the other user's desktops so that when you switch users you have to quit iPhoto before working.  Is there a way of limiting iPhoto opening onlu on the currect logged in u

  • Bind on parameters performance problem

    For some reason when I select bind on parameters in toplink I get a major performance hit for certain queries. I've enabled the toplink performance profiler to log the sql queries. I wrote a little Java class that executes these queries using a state