把String sourceURL = "jdbc:oracle:thin:@server:1521:databasename";改为
String sourceURL = "jdbc:oracle:thin:@unit-p8f3h9sp4o:1521:databasename";
或者是你的@server,改为@你机器的ip地址,
注意,你必须先启动你的监听服务.
String sourceURL = "jdbc:oracle:thin:@unit-p8f3h9sp4o:1521:databasename";
或者是你的@server,改为@你机器的ip地址,
注意,你必须先启动你的监听服务.
解决方案 »
- oracle 存储过程中数据类型转换
- 请教一个关于一个平均值的SQL语句
- sql查询效率
- sql server存储过程转换成oracle存储过程
- oracle与aix
- 插入timestamp类型的数据到oracle中出问题
- 先20分,如果有人能解决我的问题,我再追加分数,保证满意
- 刚才在MSQL看到的,大家来试下
- 怎么取得某个SQL操作是哪个用户执行的,即取得么某个用户在某段时间内都执行了什么SQL操作
- 问一个关于在oracle9i的sql plus和Enterprise Manager Console中登录的问题.
- 怎样把listview中的所有数据项放入一个二维数组里?(在线等待)
- 关于一个loadjava的问题
/*
* This sample shows how to list all the names from the EMP table
*
* It uses the JDBC THIN driver. See the same program in the
* oci8 samples directory to see how to use the other drivers.
*/// You need to import the java.sql package to use JDBC
import java.sql.*;class Employee
{
public static void main (String args [])
throws SQLException
{
// Load the Oracle JDBC driver
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); // Connect to the database
// You must put a database name after the @ sign in the connection URL.
// You can use either the fully specified SQL*net syntax or a short cut
// syntax as <host>:<port>:<sid>. The example uses the short cut syntax.
Connection conn =
DriverManager.getConnection (//"jdbc:oracle:thin:@dlsun511:1721:dbms733",
"jdbc:oracle:thin:@unit-p8f3h9sp4o:1521:AHAU","scott", "tiger"); // Create a Statement
Statement stmt = conn.createStatement (); // Select the ENAME column from the EMP table
ResultSet rset = stmt.executeQuery ("select ENAME from EMP"); // Iterate through the result and print the employee names
while (rset.next ())
System.out.println (rset.getString (1));
}
}并把含thin JDBC驱动的包加入classpath一起编译了,为什么编译通过了,但是运行起来却总是提示:Exception in thread "main":java.lang.NoClassDefFoundError:Employee