Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert Java.AWT.Color to HEX String

807600Oct 29 2007 — edited Oct 29 2007
I've managed to load the String for color out of the database.. like this
String sql = "SELECT * FROM flowchart WHERE ProcesID = " + ProcesID;
			System.out.println(sql);
			ResultSet resultset = statement.executeQuery(sql);
			
			while (resultset.next()){
				String tmpColor = resultset.getString("color");
				color = new Color(Integer.parseInt(removeChar(tmpColor, '#'), 16));
			}
which I found somewhere on the internet..
now I want to save stuff to the database.. which needs a varchar(10)
how do I get the correct value?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2007
Added on Oct 29 2007
5 comments
4,442 views