Home » Developer & Programmer » JDeveloper, Java & XML » i want solution
i want solution [message #92577] Tue, 21 September 2004 21:25
jewal
Messages: 1
Registered: September 2004
Junior Member
Hi,
> i cannot connect oracle database by following ways. it send me to
> classnotfound exceptin.
>  import java.sql.*;
>   import java.awt.*;
>   import java.awt.event.*;
>   import javax.swing.*;
>   class testconnection{
>   public static void main(String ab[[]])
>      {
>           try
>        {
>          System.out.println("Connecting to Oracle 9i
>  Server...............");
>      Class.forName("oracle.jdbc.driver.OracleDriver");
>               String url = "jdbc:oracle:thin:@192.168.24.83:1521:A";
>           &nb!
> sp;
>  String user = "scott";
>             String pwd = "tiger";
>               Connection con =
> DriverManager.getConnection(url,user,pwd);
>              Statement stmt = 
>
con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
>             System.out.println("Connected to Oracle 9i Server
>  Successfully..");
>             //return true;
>       }
>       catch (ClassNotFoundException cnfex){
>         cnfex.printStackTrace();
>         //return false;
>       }
>       catch (SQLException cnfex){
>         cnfex.printStackTrace();
>        // return false;
>       }
>      }
>   }

>  Best regards.
>  jewal
>
Previous Topic: unable to connect ora9i to JDBC
Next Topic: exception - security manager - sending email using java stored procedure
Goto Forum:
  


Current Time: Fri Apr 19 09:00:19 CDT 2024