Hey!
 
For prob #1.  I would change the name of the local variable from the same name as the session variable.  Might be crossing some wires somewhere.
 
For prob #2.  Don't know the name of the method, but I imagine that there is some way to check if the rs.field is NULL before you try to access it.
 
For prob #3.  I would try getting the value from the database as a string and instantiating a new instance of a BigDecimal.
 
java.math.BigDecimal myBig = new java.math.BigDecimal(rs.getString("CAND_ID")
 
My two cents!!!
 
Hope it helps,
 
Matthew Butler
[EMAIL PROTECTED]
-----Original Message-----
From: SoftTeam Blas Catherine [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 22, 1999 11:05 AM
To: [EMAIL PROTECTED]
Subject: Several problems

I have several pbs :
 
1. I store this in the session object : CEFFFF (it's the code of a color)
 
   session.putValue("CouleurTitre","CEFFFF");
 
And I want to retrieve it in order to put it in a table, I do this :
 
String CouleurTitre = session.getValue("CouleurTitre").toString();
 
CouleurTitre contains the right value, but the pb is when I put it in the table :
 
... <td bgcolor="#<%=CouleurTitre%>"> ....</td> ...
 
The color that I can see on my screen is not the right. When I do "View source", the code obtained looks like OK :
...
<td bgcolor="#CEFFFF
">
 
Any suggestions to my pb would be appraciated.
 
2. I execute a request and I want to retrieve a field and display it  :
 
<%=rs.getString("Cand")%>
 
But when its value is null, I have an error message (SQLException: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
).
 
 
3. In my database, I have a field with the type : decimal. How can I retrieve it. :
 
I import the class java.math.*
and I have put the following code : rs.getBigDecimal("CAND_ID")
 
 
Thanks in advance for your help.
 
(I hope you understand what I have said).
 
 
 
 
 
 
 
 
 
 
 

Reply via email to