Thread: JDBC Error

JDBC Error

From
"Ing. Jhon Carrillo"
Date:
Dear friend,
 
I want  to create a conection  to postgreSQL database with  "forte for java 4" and  this returns an error message:
 
************************************************************
Driver cargado
java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getConnection(DriverManager.java:532)
        at java.sql.DriverManager.getConnection(DriverManager.java:171)
        at Prueba.main(Prueba.java:26)
 
**************************************************************
 
 
 this is the code:
 
*************************************************************************************
import java.sql.*;
 
public class Prueba
{
   public static void main(String ar[])
   {
        try
        {
            String driver="org.postgresql.Driver";
            Class.forName(driver);
            System.out.println("Driver cargado");
           
            String url="jdbc:tbase://192.168.0.20:5432";
           
            Connection conn=DriverManager.getConnection(url,"postgres","internal");
            System.out.println("conectado");
           
            //Class.forName("org.postgresql.Driver");
           
        }catch(Exception e)
        {
            e.printStackTrace();
        }
   }
   
}
 
please help me,
 
thank

Re: JDBC Error

From
Kris Jurka
Date:

On Fri, 21 Jan 2005, Ing. Jhon Carrillo wrote:

>             String url="jdbc:tbase://192.168.0.20:5432";
>

This is not a valid postgresql url.  It should look like:

jdbc:postgresql://192.168.0.20:5432/mydbname

Kris Jurka