Adrian has the right solution -- store the rgb values in the database. Then your code would be
while(ors.next())
{
Int dbresult = ors.getInteger(1);
Color color = new Color(dbresult); //error results from this line
ompoint.setFillColor(color);
}
This way you can have many different color combinations -- roughly 8 bit color.
Nonetheless, if changing your database scheme is not possible right now, you could do the following:
1. Create a class that extends or maintains a hashtable (composition).
2. You then implement two methods addColor(String name, int rgb) and getColor(String name).
3. Initialize the class with all the colors that you expect from your database calls. Some sample code is below:
Then your code would be:
I don't recommend this approach but it should get your around the problem that you are currently facing.