Всем привет!
вот пытаюсь адаптировать
<div class="sp-wrap"><div class="sp-head-wrap"><div class="sp-head folded clickable">код (для истории)</div></div><div class="sp-body"><div class="sp-content"><!--shcode--><pre><code class='java'>import java.sql.*;
public class DemoDriver {
public static void main(String[] args) {
try {
// load the driver into memory
Class.forName("org.aarboard.jdbc.xls.XlsDriver");
// create a connection. The first command line parameter is assumed to
// be the directory in which the .xls files are held
Connection conn = DriverManager.getConnection("jdbc:aarboard:xls:" + args[0]);
// create a Statement object to execute the query with
Statement stmt = conn.createStatement();
// Select the columns from sample.xls
ResultSet results = stmt.executeQuery("SELECT * FROM sample");
// dump out the results
while (results.next()) {
System.out.println("ID= " + results.getString("ID") + " NAME= " + results.getString("NAME"));
}
// clean up
results.close();
stmt.close();
conn.close();
}
catch (Exception e) {
System.out.println("Oops-> " + e);
}
}
}[/CODE]Но вот как-то не получается... в итоге получаю такую ошибку:
Как решить вопрос?
вот пытаюсь адаптировать
Ссылка скрыта от гостей
под агент.<div class="sp-wrap"><div class="sp-head-wrap"><div class="sp-head folded clickable">код (для истории)</div></div><div class="sp-body"><div class="sp-content"><!--shcode--><pre><code class='java'>import java.sql.*;
public class DemoDriver {
public static void main(String[] args) {
try {
// load the driver into memory
Class.forName("org.aarboard.jdbc.xls.XlsDriver");
// create a connection. The first command line parameter is assumed to
// be the directory in which the .xls files are held
Connection conn = DriverManager.getConnection("jdbc:aarboard:xls:" + args[0]);
// create a Statement object to execute the query with
Statement stmt = conn.createStatement();
// Select the columns from sample.xls
ResultSet results = stmt.executeQuery("SELECT * FROM sample");
// dump out the results
while (results.next()) {
System.out.println("ID= " + results.getString("ID") + " NAME= " + results.getString("NAME"));
}
// clean up
results.close();
stmt.close();
conn.close();
}
catch (Exception e) {
System.out.println("Oops-> " + e);
}
}
}[/CODE]Но вот как-то не получается... в итоге получаю такую ошибку:
Код:
05/15/2012 14:26:23 Agent error: java.lang.ClassNotFoundException: org.aarboard.jdbc.xls.XlsDriver
05/15/2012 14:26:23 Agent error: at lotus.domino.AgentLoader.loadClass(Unknown Source)
05/15/2012 14:26:23 Agent error: at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
05/15/2012 14:26:23 Agent error: at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
05/15/2012 14:26:23 Agent error: at java.lang.Class.forName0(Native Method)
05/15/2012 14:26:23 Agent error: at java.lang.Class.forName(Class.java:120)
05/15/2012 14:26:23 Agent error: at JavaAgent.NotesMain(Unknown Source)
05/15/2012 14:26:23 Agent error: at lotus.domino.AgentBase.runNotes(Unknown Source)
05/15/2012 14:26:23 Agent error: at lotus.domino.NotesThread.run(NotesThread.java:249)