这是我的预言procedure
:
FUNCTION JavaHefExtract_runSingle (
p_company_cd varchar2,
p_srcConnString varchar2,
p_destConnString varchar2,
p_mode number,
p_period number
) return varchar2
IS
LANGUAGE JAVA
NAME 'HefExtract.DoIt(java.lang.String, java.lang.String, java.lang.String, int, int ) return java.lang.String';
这是我的java function
:
import com.microsoft.sqlserver.jdbc.*;
import java.math.BigInteger;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Enumeration;
import oracle.jdbc.*;
import java.io.*;
public class HefExtract
{
public static String DoIt(String orgName, String oracleConnstring, String sqlConnstring, int typ, int iPeriod )
{
String errMsg = null;
Connection sqlConn;
Connection oracleConn;
try
{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Class.forName("oracle.jdbc.OracleDriver");
if (oracleConnstring != null)
oracleConn = DriverManager.getConnection(oracleConnstring);
else
oracleConn = new OracleDriver().defaultConnection();
sqlConn = DriverManager.getConnection(sqlConnstring);
} catch (Throwable e1) {
CharArrayWriter byteSink = new CharArrayWriter();
e1.printStackTrace(new PrintWriter(byteSink));
return byteSink.toString();
}
return errMsg;
}
}
procedure
当我在块中调用 oracle时,PL/SQL
会返回此错误:
java.lang.ClassNotFoundException: com/microsoft/sqlserver/jdbc/SQLServerDriver at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java) at HefExtract.DoIt(HEFEXTRACT:415)
此错误背后的原因可能是什么?