Execlµ¼Èënotes JAVA´úÀí
import lotus.domino.*;
import java.io.*;
import java.util.Vector;
import jxl.*;
/*******************************************************************************
* @saveSQMessageToOracle
* @×÷ÕߣºÐ컪Ïé
* @2009Äê10ÔÂ28ÈÕ
* @˵Ã÷£ºExeclÎļþµÄµ¼Èë
******************************************************************************/
public class inputExecl_new extends AgentBase {
public void NotesMain() {
System.out.println("´úÀí¿ªÊ¼");
EmbeddedObject ebd = null;
String srcFile = "";
InputStream is = null;
Workbook wb = null;
Sheet st = null;
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Document currentDoc = agentContext.getDocumentContext();
Database currentDB = agentContext.getCurrentDatabase();
Database wjkhDB = session.getDatabase(currentDB.getServer(),
"whcg/linkey_weijkh.nsf");
String path = currentDoc.getItemValueString("Path");
View wjkhView = wjkhDB.getView("showtousNo");
Vector vtr = session.evaluate("@AttachmentNames", currentDoc);
srcFile = new String("" + vtr.get(0).toString());
ebd = currentDoc.getAttachment(srcFile);
ebd.extractFile(srcFile);
is = new FileInputStream(srcFile);
wb = Workbook.getWorkbook(is);
if (ebd == null) {
wb.close();
wb = null;
return;
}
if (ebd.getType() != EmbeddedObject.EMBED_ATTACHMENT) {
wb.close();
wb = null;
return;
}
st = wb.getShe
Ïà¹ØÎĵµ£º
1. import java.util.*;
2.(A) public class Test
{ public static void main(String[] args)
{
//Éú³É [0-n) ¸ö²»Öظ´µÄËæ»úÊý st ÓÃÀ´±£´æ ......
·´ÉäÊÇJavaÓïÑÔÖкÜÖØÒªµÄÒ»¸ö×é³É²¿·Ö£¬ËùÒԾʹ˻°ÌâÌÖÂÛµÄ×ÊÔ´¿ÉνÊýÖ®²»¾¡£¬ÈÕ³£¿ª·¢Ò²»á¾³£Ê¹Óõ½¹ØÓÚ·´ÉäµÄReflection
API¡£Java5.0
Tiger³öÏÖÒԺ󣬸ü¶Ô·´ÉäAPIÓÐÁËеÄÀ©Õ¹£¬¾¡¹ÜÌÖÂ۵Ļ°ÌâºÜ¶à£¬²»¹ýÎÒ»¹ÊǾõµÃ²»¹»È«Ã棬ÓÈÆäÊǶԷºÐÍÕâÒ»¿é£¬ËùÒÔ¾ÍÎÒËùÖª£¬ÔÙ»¨Á¦Æø×ܽáÒ»·¬
Ê×ÏÈ·´ÉäµÄÈë¿ÚÊÇ´ÓClass¿ ......
Java ¶ÔÎļþ½øÐжÁд²Ù×÷µÄÀý×Ӻܶ࣬ÈóõѧÕ߸е½Ê®·ÖÀ§»ó£¬ÎÒ¾õµÃÓбØÒª½«¸÷ÖÖ·½·¨½øÐÐ
Ò»´Î·ÖÎö£¬¹éÀ࣬ÀíÇ岻ͬ·½·¨Ö®¼äµÄÒìͬµã¡£
Ò»£®ÔÚ JDK 1.0 ÖУ¬Í¨³£ÊÇÓà InputStream & OutputStream ÕâÁ½¸ö»ùÀàÀ´½øÐжÁд²Ù×÷µÄ¡£
InputStream ÖÐµÄ FileInputStream ÀàËÆÒ»¸öÎļþ¾ä±ú£¬Í¨¹ýËüÀ´¶ÔÎļþ½øÐвÙ×÷£¬ÀàËÆ ......
Èç¹ûÒ»¸öÀà³ÉÔ±±»ÉùÃ÷Ϊstatic£¬Ëü¾ÍÄܹ»ÔÚÀàµÄÈκζÔÏó´´½¨Ö®Ç°±»·ÃÎÊ£¬¶ø²»±ØÒýÓÃÈκζÔÏó¡£static ³ÉÔ±µÄ×î³£¼ûµÄÀý×ÓÊÇmain( ) ¡£ÒòΪÔÚ³ÌÐò¿ªÊ¼Ö´ÐÐʱ±ØÐëµ÷ÓÃmain() £¬ËùÒÔËü±»ÉùÃ÷Ϊstatic¡£
ÉùÃ÷ΪstaticµÄ±äÁ¿ÊµÖÊÉϾÍÊÇÈ«¾Ö±äÁ¿¡£µ±ÉùÃ÷Ò»¸ö¶ÔÏóʱ£¬²¢²»²úÉústatic±äÁ¿µÄ¿½±´£¬¶øÊǸÃÀàËùÓеÄʵÀý±äÁ¿¹²ÓÃͬһ¸ö ......
/*µ±Ö´ÐÐSQLʱ·¢ÏÖ²»ÄÜÁ¬½ÓÊý¾Ý¿â£¬ÏÈÖØÁ¬Ò»´Î*/
import java.io.FileInputStream;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
......