error conection


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: error conection

  1. #1
    Mozart G. S. Junior Guest

    error conection

    i changed the code for stand alone

    try {

    new sun.jdbc.odbc.JdbcOdbcDriver();

    System.out.println("Conectando ao Oracle..." );
    GlobalConexao = DriverManager.getConnection(url,us,se);


    GlobalStmt = GlobalConexao.createStatement();
    System.out.println("Conexao realizada com sucesso !!" );
    }
    catch(java.lang.Exception ex)
    {
    System.out.println("Excecao de principal 1" );
    ex.printStackTrace();
    }


    now it presents this error


    c:\jdk1.3.0_02\bin\java.exe AtpEstatisticaRva
    Working Directory - C:\Meus documentos\Teste\AtpEstatistica\
    Class Path -
    ..;C:\kawa321\kawaclasses.zip;c:\jdk1.3.0_02\lib\tools.jar;c:\jdk1.3.0_02\jre
    \lib\rt.jar
    Conectando ao Oracle...

    Excecao de principal 1

    java.sql.SQLException: No suitable driver

    at java.sql.DriverManager.getConnection(DriverManager.java:537)

    at java.sql.DriverManager.getConnection(DriverManager.java:177)

    at AtpEstatisticaRva.<init>(AtpEstatisticaRva.java:62)

    at AtpEstatisticaRva.main(AtpEstatisticaRva.java:221)

    Excecao de criacao do Statement

    java.lang.NullPointerException

    --
    Grato,
    Mozart



  2. #2
    Bucetrux O'Brian Altias Guest

    Re: error conection


    Itīs simple to fix it. Just put oracle driver in the CLASSPATH!!!!

    "Mozart G. S. Junior" <mozart@atp.com.br> wrote:
    >i changed the code for stand alone
    >
    >try {
    >
    > new sun.jdbc.odbc.JdbcOdbcDriver();
    >
    > System.out.println("Conectando ao Oracle..." );
    > GlobalConexao = DriverManager.getConnection(url,us,se);
    >
    >
    > GlobalStmt = GlobalConexao.createStatement();
    > System.out.println("Conexao realizada com sucesso !!" );
    > }
    > catch(java.lang.Exception ex)
    > {
    > System.out.println("Excecao de principal 1" );
    > ex.printStackTrace();
    > }
    >
    >
    >now it presents this error
    >
    >
    >c:\jdk1.3.0_02\bin\java.exe AtpEstatisticaRva
    >Working Directory - C:\Meus documentos\Teste\AtpEstatistica\
    >Class Path -
    >..;C:\kawa321\kawaclasses.zip;c:\jdk1.3.0_02\lib\tools.jar;c:\jdk1.3.0_02\jre
    >\lib\rt.jar
    >Conectando ao Oracle...
    >
    >Excecao de principal 1
    >
    >java.sql.SQLException: No suitable driver
    >
    > at java.sql.DriverManager.getConnection(DriverManager.java:537)
    >
    > at java.sql.DriverManager.getConnection(DriverManager.java:177)
    >
    > at AtpEstatisticaRva.<init>(AtpEstatisticaRva.java:62)
    >
    > at AtpEstatisticaRva.main(AtpEstatisticaRva.java:221)
    >
    >Excecao de criacao do Statement
    >
    >java.lang.NullPointerException
    >
    >--
    >Grato,
    >Mozart
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center