Alguem sabe um totorial para instalar o jdbc para postgresql for linux;
import javax.swing.<em>;
import java.awt.</em>;
import java.awt.event.<em>;
import java.util.</em>;
public class ConectarPostgresql extends JFrame {
private Connection connection;
public ConectarPostgresql()
{
// The URL specifying the Books database to which
// this program connects using JDBC to connect to a
// Microsoft ODBC database.
String url = “jdbc:postgresql:SCGLI”;
String username = “postgres”;
String password = “localfach”;
// Load the driver to allow connection to the database
try {
Class.forName( "org.postgresql.Driver" );
connection = DriverManager.getConnection(
url, username, password );
}
catch ( ClassNotFoundException cnfex ) {
System.err.println(
"Failed to load JDBC/ODBC driver." );
cnfex.printStackTrace();
System.exit( 1 ); // terminate program
}
catch ( SQLException sqlex ) {
System.err.println( "Unable to connect" );
sqlex.printStackTrace();
}
setSize( 450, 150 );
show();
}
public static void main( String args[] )
{
final ConectarPostgresql app = new ConectarPostgresql();