20 pts.
 getting a Lotus Notes text field into a java program
Hi! I wrote a Java program that has a connection to a Lotus Notes database. I need to retrieve the value of one specific field in a form. This field is defined as a text field. When I retrieve this value from the ResultSet, I receive a String that's only 256 characters in length (that is, it seems that the string is truncated to that length). Is there any way I could receive the whole string, no matter how long it is? A code sample would be greatly appreciated. Thanks in advance! :D Melissa

Software/Hardware used:
ASKED: October 12, 2006  2:54 PM
UPDATED: October 12, 2006  5:50 PM

Answer Wiki:
You will need to get the Notes Java API jar file and use the Domino Object Model to get the entire contents of the field. It can be obtained from the Domino server or Notes Client. Here is a code sample of a Domino Java Agent. You should be able to modify it to work from with in Java. import lotus.domino.*; public class JAGetFieldContentsExample extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); Database ndbCurr = agentContext.getCurrentDatabase(); Document ndocResultsDoc = ndbCurr.createDocument(); Document ndocCurr = agentContext.getDocumentContext(); Item nitem = ndocCurr.getFirstItem("query"); String strQuery = nitem.getValueString(); if(strQuery !="") { // Process value retrieved here } // end if } catch(Exception e) { e.printStackTrace(); } // end try .. catch block } // end method main } // end class
Last Wiki Answer Submitted:  October 12, 2006  5:50 pm  by  Maggs   0 pts.
All Answer Wiki Contributors:  Maggs   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _