getting a Lotus Notes text field into a java program

20 pts.
Tags:
Java
Lotus Domino
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following