Save past database record instead of being overwritten [closed] - java

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
please help. We are building sort of a log in/ log out program, wherein we record the time he logs in and logs out, but we have a little problem, when he logs in again, the past record is overwritten. We just need some help of any ideas or methods of storing the past log in/ log out time instead of it being overwritten. Thanks in advance!

you can use relational database for that like #MadProgrammer's statement.then you can keep a separate table for store user's login history .you don't need to overwrite.
for example see the picture below
i have show you a example er diagram and table structure for clarify

Save this log as separate records.

Related

What is the most efficient way to use database? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm new to using a database, specifically MySQL. I'm creating a web application for class in which you can look up the name of a book and it'll display the summary of the book. My question is should I send a query to the database that collects all of the books' data on initialization and put them into a HashMap inside a manager class for lookup or should I use a query each time to lookup a specific book information?
It depends on the data transport time I would say. If your average query time times the number of request goes faster than a script to put everything into a HashMap, use queries. Otherwise, use a script that collects everything and puts it into a HashMap.
But if you have thousands of rows, you should use queries, because otherwise you will use too much RAM.

Efiiciency for Pagination in Java [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am writing Pagination for a set of records in Java. Here i am talking to a service which fetches a result set of 500 per time. I interact with that service to display at most 50 records at a time with page markers.
Is it a really efficient model or if there is any other way to improve the suggested pagination model ?
Depends on your data.
If your data is rapidly changing, this definitely isn't a suitable method. I would suggest tweaking the service to return only as much requested records that are needed by the page.
If data is static and need not be time dependent, this should work fine. Just fetch the 500 records, put it in a local array and display from there. Once this is exhausted, replenish the same.

hibernate update only some fields [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
In some cases I want to update only one collumn, but I don't want to get the object from the data base and I only have it's ID and the value I want to update.
As the other values are null, the hibernate are updating then as null.
I wonder some criteria to erase the other columns from the update.
I read about dynamic-update=true and its only exclude the unmodified properties. But the nulls are still there at my update.
Does anyone have any idea?
Thanks!
Felipe
You have to get the object from the database, change the value and save it. If you don't want that, you have to write your own query.

Search or filter JTable on button click [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
How can I perform a search in JTable?
My CSV file contains:
stdid 001
stdname monish
dob 03/5/1789
And similar records for the rest of the file. I am able to bind using CSV Parser and get data into JTable. I want to perform a search on it the table using input from a JTextField. How can I perform this?
You can use a RowFilter/RowSorter. You can read more at Sorting and Filtering from the How to use Tables tutorial.
You can can also see a working example in the question posted here.
The accepted answer also provides a solution for case-insensitive filtering, if you're interested in that functionality

How to combine many(1000) png file together in one big file system where we can iterate and get all if needed [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am putting many images on HDFS. However each one is taking 64MB Block there.As the count of images are very high So wanted to put all image information in one big file. Now this will be feed to mapper to process it faster . What inputformat i can use? Or do i need to use sequencefile concepts ?i am not much sure as how to proceed further could someone please suggest some better way to deal this.
Just throw them all in a Zip.
Really you would be better off using a Database (for example MongoDB) and store them all in there though.

Categories