当前位置: 技术问答>java相关
一个老大男的一个老大难
来源: 互联网 发布时间:2014-12-27
本文导语: samp1 java.lang.UnsatisfiedLinkError: make_c_state --at oracle.jdbc.oci7.OCIDBAccess.make_c_state(Native Method) --at oracle.jdbc.oci7.OCIDBAccess.logon(OCIDBAccess.java:148) --at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:103) --at oracle.jdbc.driver.OracleDri...
samp1
java.lang.UnsatisfiedLinkError: make_c_state
--at oracle.jdbc.oci7.OCIDBAccess.make_c_state(Native Method)
--at oracle.jdbc.oci7.OCIDBAccess.logon(OCIDBAccess.java:148)
--at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:103)
--at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:148)
--at java.sql.DriverManager.getConnection(DriverManager.java:517)
--at java.sql.DriverManager.getConnection(DriverManager.java:199)
--at samp1.main(samp1.java:23)
Exception in thread "main"
什么意思?什么地方出错了?应该如何改动?
源码如下:
/** Simple example on using Oracle XMLSQL API; this class queries the database with "select * from emp" in scott/tiger schema; then from the results of query it generates an XML document */
import org.w3c.dom.*;
import java.sql.*;
import java.math.*;
import oracle.xml.sql.query.*;
import oracle.jdbc.*;
import oracle.jdbc.driver.*;
public class samp1
{
//========================================
// main() - public static void
public static void main(String args[]) throws SQLException
{
String tabName = "emp";
String user = "scott/tiger";
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
//init a JDBC connection
Connection conn =
DriverManager.getConnection("jdbc:oracle:oci8:"+user+"@");
// create statement and execute it to get the ResultSet
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select * from "+tabName );
// init the OracleXMLQuery; note we could have passed the sql query string
// instead of the ResultSet
OracleXMLQuery qry = new OracleXMLQuery(conn,rset);
// get the XML document is the string format
String xmlString = qry.getXMLString();
// print out the result
System.out.println(" OUPUT IS:n"+xmlString);
}
}
java.lang.UnsatisfiedLinkError: make_c_state
--at oracle.jdbc.oci7.OCIDBAccess.make_c_state(Native Method)
--at oracle.jdbc.oci7.OCIDBAccess.logon(OCIDBAccess.java:148)
--at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:103)
--at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:148)
--at java.sql.DriverManager.getConnection(DriverManager.java:517)
--at java.sql.DriverManager.getConnection(DriverManager.java:199)
--at samp1.main(samp1.java:23)
Exception in thread "main"
什么意思?什么地方出错了?应该如何改动?
源码如下:
/** Simple example on using Oracle XMLSQL API; this class queries the database with "select * from emp" in scott/tiger schema; then from the results of query it generates an XML document */
import org.w3c.dom.*;
import java.sql.*;
import java.math.*;
import oracle.xml.sql.query.*;
import oracle.jdbc.*;
import oracle.jdbc.driver.*;
public class samp1
{
//========================================
// main() - public static void
public static void main(String args[]) throws SQLException
{
String tabName = "emp";
String user = "scott/tiger";
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
//init a JDBC connection
Connection conn =
DriverManager.getConnection("jdbc:oracle:oci8:"+user+"@");
// create statement and execute it to get the ResultSet
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select * from "+tabName );
// init the OracleXMLQuery; note we could have passed the sql query string
// instead of the ResultSet
OracleXMLQuery qry = new OracleXMLQuery(conn,rset);
// get the XML document is the string format
String xmlString = qry.getXMLString();
// print out the result
System.out.println(" OUPUT IS:n"+xmlString);
}
}
|
哦,你用的oci驱动,本地装了net8没有?
其实你也可以试试thin driver.
:)
其实你也可以试试thin driver.
:)
|
还有my01是你建的oracle的实例吗?
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。