ARM环境Oracle客户端

Oracle的JDBC是跨平台的数据库驱动,可以在ARM体系上运行。

Raspberry Pi and Oracle 介绍的经验可以参考

import java.sql.*;
class Conn {
public static void main (String[] args) throws Exception
{
Class.forName (“oracle.jdbc.OracleDriver”);

Connection conn = DriverManager.getConnection
(“jdbc:oracle:thin:@//ip_or_dns_name_of_oracle_server:port_server/SID_Database”, “login_database”, “password_database”);
// @//machineName:port/SID,   userid,  password
try {
Statement stmt = conn.createStatement();
try {
ResultSet rset = stmt.executeQuery(“select BANNER from SYS.V_$VERSION”);
try {
while (rset.next())
System.out.println (rset.getString(1));   // Print colon 1
}
finally {
try { rset.close(); } catch (Exception ignore) {}
}
}
finally {
try { stmt.close(); } catch (Exception ignore) {}
}
}
finally {
try { conn.close(); } catch (Exception ignore) {}
}
}
}
  • 编译Java:

javac Conn.java
  • 测试连接

java -cp /wherever_you_put_the_file/ojdbc7.jar:. Conn

以上我还没有实践,思路应该是可行。

Last updated