On Thu, 24 Jul 2003, Horatio B. Bogbindero wrote:
..
> make sure you install the Oracle client software (Net8 or equivalent).

Oh yeah. Or, if you are Truly Masochistic, you can use this little 
program.. much more lightweight than running the Net8 client (well you 
would need a JRE and the 1.2MB Oracle type 4 JDBC driver, but at least you 
wouldn't need Oracle's bloatware client)


--- test program ---
import java.sql.*;
import java.math.*; 

public class hello {
        public static void main(String[] args) {

                try {
                        Class.forName ("oracle.jdbc.driver.OracleDriver");
                } catch (ClassNotFoundException e) {
                        System.err.println("Database is not OK: " + e.getMessage());
                }

                try {
                        String dbUrl = "jdbc:oracle:thin:@127.0.0.1:SID";
                        
                        Connection conn = DriverManager.getConnection 
                                (dbUrl, "scott", "tiger");

                        Statement stmt = conn.createStatement();
                        ResultSet rset = stmt.executeQuery ("SELECT SYSDATE FROM 
DUAL");

                        while (rset.next()) {
                                System.err.println("Database is OK\n");
                        }
                        
                        rset.close();
                        stmt.close();
                        conn.close();

                } catch (SQLException ex) {
                        System.err.println("Database is not OK: " + ex.getMessage());
                }
        }
}


---
Orlando Andico <[EMAIL PROTECTED]>
Mosaic Communications, Inc.

--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie

Reply via email to