Hello, What's the best data structure to store and retrieve data in the form of record, to and from disk, respectively? This should also let one search the record based on criteria from a record field. I was thinking of RandomAccessFile but just wondering if there are newer alternatives. In term of performance, does it matter if I try something like retrieving the record in saved File object , then put the fields into an array, then use Arrays to binarySearch? Also, how is this compared to Linklist or Tree? Is it true that if one has jdbc connection, this can easily be done in the backend? Thank you.
Hello, For some reason, I ran into peculiar situation sometimes delete() works, and other times it doesnt, especially when I put the code snippet as part of a bigger application. I just wonder if anyone have similar experience. Example: .... String fileName=(String)listbox.getSelectedValue(); System.out.println("file to be deleted= "+fileName);//printed filename correctly File f = new File("c:\\temp", fileName); System.out.println(f.delete());//printed 'false' even if the file is indeed in the c:\temp directory as specified, and it's not deleted or in other simple case... import java.io.*; public class del { public static void main(String args[]) { File path = new File("c:\\temp"); File f=new File(path,"somefilename"); System.out.println(f.delete());//printed 'false' even if the file with "somefilename" exists in c:\temp }}
Hello, I got 2 frames, the first frame has text fields and combo boxes displaying a data record and the second frame let user choose a data record from a combo box to be displayed on the first frame. Both use data from a shared record object. If a user click on a button on the first frame, the second frame pops up and let user choose a new record. After clicking on a button on the second frame, the new data record displays on the first frame. My problem is to make the new data record displayed on the first frame. I make the first frame a member, and pass it as object to the second frame. Then I call the functions created in the first frame on the passed object to populate the displaying fields with data from new record, but somehow nothing were displayed. What did I do wrong? What are the alternatives? Please help. Thank you very much. --newbie
Hello, what's the significance of using "while" loop versus "if" statement in synchronized methods [pertaining to wait() and notify()] running theads? Could someone give me an example of the difference? Thank you.
thank you very much. I think I was confused because I didnt heed the scope of the variable v. It's out of scope after exiting from the call to 'another(ValHold v, int i)'.