I am writing a program to display a mysql database. I have added a search button. I would like to have someone look at the program,click search (it will display the contents of the database) then if possible break down the logical steps to take to
1click search
2capture the text and infuse it into mysql query
3step 2 is dependent on the combo box selection
4create a list to populate it with resultset
5display this list

Now I could probably do all this this actionListeners and actionperformed but I am trying to grasp the @Action concept along with BeanInfo class. So A complete breakdown of code is asking to much. I would like to get a general approach in order to lean how to get components to put data into libraryies(I don't understand how to use libraries yet) and then use this metadata to use action commands and actionperformed etc (of which I understand the basics)
I shoud have uploaded target.zip
Any feedback would be appreciated.
Thanks
ceyesuma

Recommended Answers

All 4 Replies

The query can easily be built dynamically based upon specified strings. I don't know what more info you could need on building a string.

I would recommend using JTable to display the result. You don't need an intermediate list and there are plenty of code examples of populating a JTable with a JDBC resultset.

I'm not following at all what you are trying to say in that last paragraph, so I can't offer much suggestion on that.

Thanks
I am just trying to lean how to gather data ,use libraries . I am not really sure. what I have seen so far is there is a beanInfo class or libraries??? that act as a middle ground between components . Could you explain this better?

Property Design Patterns

Property design patterns are used to identify the publicly accessible properties of a bean. Not surprisingly, property design patterns are closely related to accessor methods. In fact, you didn't really know it at the time, but in the previous chapter you were adhering to a design pattern when you saw the sample accessor methods for various properties. It turns out that accessor methods are the means by which the JavaBeans automatic introspection facilities determine which properties a bean exposes. Basically, any time the JavaBeans introspector encounters a public getter or setter method, it assumes the property in question is a public property and exposes it to the outside world.

If you recall from the previous chapter, properties need not always have pairs of accessor methods. For example, if a property has only a getter method, JavaBeans assumes it is a read-only property. Likewise, if a property has only a setter method, JavaBeans assumes it is a write-only property. If both methods are defined, guess what? You got it, the property is a read-write property. As you can see, design patterns are amazingly simple, but quite effective.

The design patterns for properties vary a little based on the type of property. Here are the property types supporting different design patterns:

* Simple properties

* Boolean properties

* Indexed properties

Simple Properties Simple properties consist of all single-valued properties, which include all built-in Java data types as well as classes and interfaces. For example, int, long, float, Color, Font, and boolean are all considered simple properties. The design patterns for simple property accessor methods follow:

public <PropertyType> get<PropertyName>();

public void set<PropertyName>(<PropertyType> x);


So, for a property called numBullets that is of type long, the following accessor methods would safely conform to the introspection design patterns:

public long getNumBullets();

public void setNumBullets(long nb);

thank you dear, i will try to implement this code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.