简体   繁体   中英

JSP Dropdown list from database

just a newbie question, i am currently developing a system and it has a form that needs to be filled out by the users,

I'm planning on populating several dropdown lists using data extracted from the database using hibernate.

The question is, would it be wise if I do that? let's assume that i have 3-4 dropdowns that would each have 50-100+ options coming from the database. will it encounter performance issues? Thanks.

You would be better off allowing users to search within the dropdown and filtering the results once they have entered a certain minimum amount of characters (say 3 or 4).

With that number of results you will likely need filtering anyway, and doing it this way means you are not loading all of the data at once, and you are only loading the data that is needed.

Data-driven performance problems aren't new and Most of the time it's related to too much data queried from the database. There are tons of good resources on "Optimization".

Overview of link below: If you're doing ORM, Hibernate etc..There are some basics to keep your options open when it comes to performance:

Don't do explicit flushing

Don't disable lazy loading in your mappings

Don't use Session.clear()

Hibernate performance

The way Hibernate basically promises to deliver performance is through caching and changing the amount of data that is fetched each time. This works for most of the cases where you use Hibernate. If not, you might just need to do some good old SQL.

http://blog.f12.no/wp/2010/02/16/hibernate-performance-and-optimization/

I had a particular performance issue last year, what worked for me was moving UI processing/loading to the client with AJAX.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM