Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java && Firebird. Connection Problem

807588Sep 7 2007 — edited Apr 15 2009
hi . i am studing at a program abaut java and firebird. But ı cant achieve a connection between these. i am using netbeans 5.5.1, jkd 1.6.0 and firebird 2.1 at my comp. when i had run the program, i take this message "java.lang.ClassNotFoundException: org.firebirdsql.jdbc.FBDriver"
Could anyone help me abaut that topic ???
my program is as following ;
package pack1; 

import java.sql.Connection;  
import java.sql.DriverManager;  
import java.sql.Statement;  
 
public class Conexao {  
 
  public Connection conn = null;  
  public Statement stm = null;  
 
  public Conexao() {  
	  
  /*   try {  
 
        Class.forName("org.firebirdsql.jdbc.FBDriver");  
        con =  
           DriverManager.getConnection(  
              "jdbc:firebirdsql:localhost:C:Documents and Settings/buro/Desktop/erdem.gdb",  
              "SYSDBA",  
              "masterkey");  
        stm = con.createStatement();  
 
     } catch (Exception e) {  
        System.out.println("Baglanti Kurulamadi " + e.getMessage());  
     }  */
  
try
{  
    String databaseURL = "jdbc:firebirdsql://localhost/3050:C:/Documents and Settings/buro/Desktop/erdem.gdb";
    Class.forName("org.firebirdsql.jdbc.FBDriver");
    String user = "SYSDBA";
    String password = "masterkey";
    try {
    conn = java.sql.DriverManager.getConnection(databaseURL, user, password);
    System.out.println("Connection established.");
    }
    catch (java.sql.SQLException e) {
    e.printStackTrace();
    System.out.println(
    "Unable to establish a connection through the driver manager.");
    System.out.println("eeeeeeee" + e.toString());
    return;
    }
} 
catch (Exception e) 
{  System.out.println("Baglanti Kurulamadi " + e.getMessage());   }   
      
      
  }
  public static void main(String[] args)
  {
//	  System.out.println("asdasdasd");
	  Conexao aa=new Conexao();
  }
       
}  
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 13 2009
Added on Sep 7 2007
10 comments
448 views