|
Regards Bruce public static void main(String args[]) { Connection conn = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); System.out.println("Driver loaded.");String sys = "jdbc:oracle:thin:@mrcwin:1521:testdb"; conn = DriverManager.getConnection(sys, "jin", "jin");
System.out.println("Connecting to: " + sys); Statement stmt = conn.createStatement();
String sql = "SELECT COUNT(*) FROM HR.countries";ResultSet rs = stmt.executeQuery(sql); String s = "";
while (rs.next()) { } stmt.close();conn.close();
} catch (ClassNotFoundException exc) { System.out.println("Error: " + exc); exc.printStackTrace();} catch (SQLException exc) {
}} //main
Ashish Kulkarni wrote:
Hello We have a project in which we need to get some data from Oracle database, we are planning to use java and JDBC to connect to oracle to get this data. Q1 Where can i find the JDBC driver for oracle, Q2 Has anyone tested trying to get data from oracle database with a java program running on AS400. Q3 Does anyone have a sample java program to create connectio to oracle database Ashish ____________________________________________________Sell on Yahoo! Auctions - no fees. Bid on great items. http://auctions.yahoo.com/
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.