getConnection(String url, String user, String password) throws SQLExceptionDriverManager.getConnection("jdbc:oracle:thin:@host:1521:db","scott","tiger");

解决方案 »

  1.   

    在 Oracle 的 jdbc 子目录中 Demo.zip 有很多范例
      

  2.   

    到ORACLE 公司的网站上面侃侃了.有一个叫ORACLE JDBC 的书将的很详细的哟.
    我补充以下了:forclass("oracle.jdbc.driver");//好象是这么写的吧.
    Conntion myconn = DriverManager.getConnection("jdbc:oracle:thin:@host:1521:db","scott","tiger");回复人: bluesmile979(笑着) ( ) 信誉:110  2003-07-13 13:53:00  得分:0 
     
     
      getConnection(String url, String user, String password) throws SQLExceptionDriverManager.getConnection("jdbc:oracle:thin:@host:1521:db","scott","tiger");
      
     
      

  3.   

    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    String url="jdbc:oracle:thin:@localhost:1521:orcl";
    String user="scott";
    String password="tiger";
    Connection conn= DriverManager.getConnection(url,user,password);
    Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);String sql="select * from test";ResultSet rs=stmt.executeQuery(sql);
      

  4.   

    public class ConnectionPool
        {
            private static String driverName="oracle.jdbc.driver.OracleDriver";
            private static String url="jdbc:oracle:thin:@testserver:1521:heliosdb";
            private static String user="helios";
            private static String password="helios";
            public static void setDriver(String driverName)
            {
                ConnectionPool.driverName = driverName;
            }
            public static void setUrl(String url)
            {
                ConnectionPool.url=url;
            }
            public static void setUserPassword(String user,String password)
            {
                ConnectionPool.user=user;
                ConnectionPool.password=password;
            }
            public static java.sql.Connection getConnection()
            {
                java.sql.Connection conn=null;
                try
                {
                    Object oDriver=null;
                    try
                    {
                        oDriver = Class.forName( driverName ).newInstance();
                    }
                    catch(Exception ex)
                    {
                        ex.printStackTrace();
                    }
                    java.sql.Driver driver = (java.sql.Driver)oDriver;
                    java.sql.DriverManager.registerDriver(driver);
                    conn = java.sql.DriverManager.getConnection(
                        url, user,password);
                }catch(Exception ex)
                {
                    ex.printStackTrace();
                }
                return conn;
            }
        }
      

  5.   

    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    String url="jdbc:oracle:thin:@localhost:1521:orcl";
    String user="system";
    String password="manager";
    Connection conn= DriverManager.getConnection(url,user,password);JDBC的配置就是要你有到的WEBLOGIC中配置的,就是控制抬上的配置
    另外还要在你的WEBLOGIC中添加ORACLE 的class12。jar的包才可以的