Julian,
Yes, I am creating a notes java agent. I'll give an example…… more comments after below code…..
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {<br/>
try {<br/>
Session session = getSession();<br/>
AgentContext agentContext = session.getAgentContext();<br/>
// (Your code goes here) <br/>
} catch(Exception e) {<br/>
e.printStackTrace();<br/>
}<br/>
}<br/>
}// end of javaagent…
// start of new class…………
package mypackage.utils;// COMMENT THIS OUT AND ERROR GOES AWAY…..
import java.sql.;
/*
- @author haynesj
*
- TODO To change the template for this generated type comment go to
- Window - Preferences - Java - Code Style - Code Templates
*/
public class JDBCCloser {
private static OpenLogItem soli = new OpenLogItem();// ERROR OCCURS ON THIS LINE!!!
public static void close(PreparedStatement ppstmt) {
if (ppstmt != null) {<br/>
try {<br/>
ppstmt.close();<br/>
ppstmt = null;<br/>
} catch (SQLException sqle) {<br/>
sqle.printStackTrace();<br/>
System.out.println( soli.logError(sqle) ); // log and display the error<br/>
}<br/>
}<br/>
}
public static void close(Statement pstmt) {
if (pstmt != null) {<br/>
try {<br/>
pstmt.close();<br/>
pstmt = null;<br/>
} catch (SQLException sqle) {<br/>
sqle.printStackTrace();<br/>
System.out.println( soli.logError(sqle) ); // log and display the error<br/>
}<br/>
}<br/>
}
public static void close(ResultSet prez) {
if (prez != null) {<br/>
try {<br/>
prez.close();<br/>
prez = null;<br/>
} catch (SQLException sqle) {<br/>
sqle.printStackTrace();<br/>
System.out.println( soli.logError(sqle) ); // log and display the error<br/>
}<br/>
}<br/>
}
public static void close(Connection pcnxn) {
if (pcnxn != null) {<br/>
try {<br/>
pcnxn.close();<br/>
pcnxn = null;<br/>
} catch (SQLException sqle) {<br/>
sqle.printStackTrace();<br/>
System.out.println( soli.logError(sqle) ); // log and display the error<br/>
}<br/>
}<br/>
}
}//end JDBCCloser
Ok, I have clicked 'Edit Project' and browsed to 'Shared Java Libraries' where I do see the 'OpenLogClass' and I click 'Add/Replace File/s'. Next, I see the '(Library) OpenLogClass' on the right side of dialog box and I click 'OK' to save changes. When I click save using above code, I get an Errors 'mypackage\utils\JDBCCloser.java: 12: Class mypackage.utils.OpenLogitem not found.' error. If I simply comment out the package declaration line of code ( see above ), then it compiles and saves just fine. I would like to use packages.
Again, I am fairly new to java so this could be something rather simple. Any advice is appreciated. Thanks for your response.
- jamie
haynesj@amerch.com
Note: I am using the OpenLog class java sl. version 20041111a. I believe this is fairly recent. Also, your instructions in your db are really good - thanks for putting forth effort in that area. It is appreciated.