www.mh456.com防采集。
String sql="update data_collection set 列1=‘值1’ where area like ?";ps.setString(1, "%"+area+"%");
测试的电脑已经装好Oracle客户端,而且用SQLplus可以连接上。 /* * 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
import java.sql.Connection;import java.sql.DriverManager;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;public class Oracle {public static void main(String[] args) throws SQLException,e69da5e6ba903231313335323631343130323136353331333335326134ClassNotFoundException {Class.forName("oracle.jdbc.driver.OracleDriver");String url = "jdbc:oracle:thin:@127.0.0.1:1521:test";String user = "test";String password = "test";Connection conn = DriverManager.getConnection(url, user, password);PreparedStatement ps = conn.prepareStatement("select * from emp");ResultSet rs = ps.executeQuery();while (rs.next()) {System.out.println(rs.getObject(1));}rs.close();ps.close();conn.close();}}追问String url = "jdbc:oracle:thin:@127.0.0.1:1521:test"; 能不能详细分解一下这句话,里面的thin是神马? test是神马?追答thin是连接的方式,test是你的数据库,就是sid本回答被提问者采纳内容来自www.mh456.com请勿采集。