JDBC to Ingres Woessss....
From: James Kimble (jkimble_at_one.net)
Date: 10/29/03
- Next message: Lothar Kimmeringer: "Re: JDBC to Ingres Woessss...."
- Previous message: sivaPrakash: "Re: JDBC Connection Problem "CLASSNOTFOUNDEXCEPTION" in TomCat"
- Next in thread: Lothar Kimmeringer: "Re: JDBC to Ingres Woessss...."
- Reply: Lothar Kimmeringer: "Re: JDBC to Ingres Woessss...."
- Reply: Real Gagnon: "Re: JDBC to Ingres Woessss...."
- Reply: Dave Bender: "Re: JDBC to Ingres Woessss...."
- Reply: bevyn quiding: "Re: JDBC to Ingres Woessss...."
- Reply: bevyn quiding: "Re: JDBC to Ingres Woessss...."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Oct 2003 13:53:42 -0800
I'm sure I'm missing something simple here but I'm not getting it.
I've got a simple select example (right out of O'Reilly!!) application
that should be connecting to my ingres database but I can't even get
the driver to load.
The CBF utility shows a JDBC server running on our database. I've confirmed
that the driver is in a jar file in the ingres directory. When I run
the program it just says it failed to load the driver. Can someone
tell me what I'm doing wrong? Path to driver maybe? Help....
////////////////////////////////////////////////////////////////////////
import java.sql.*;
public class SelectApp
{
public static void main ( String args[] )
{
String url = "jdbc:edbc://hp:bb7/ing26;UID=t108hjk;PWD=iron2gold";
try
{
Class.forName("ca.edbc.jdbc.EdbcDriver").newInstance();
}
catch( Exception e )
{
System.out.println("Failed to load Ingres driver.");
return;
}
try
{
Connection con = DriverManager.getConnection(url);
Statement select = con.createStatement();
ResultSet result =
select.executeQuery ("SELECT slx_ord_no FROM gi");
System.out.println("Got results:");
// Process results one row at a time
while ( result.next() )
{
String slx_ord_no = result.getString(8);
System.out.println("slx_ord_no = " + slx_ord_no);
}
select.close();
con.close();
}
catch ( Exception e )
{
e.printStackTrace();
}
}
}
///////////////////////////////////////////////////////////////////////
- Next message: Lothar Kimmeringer: "Re: JDBC to Ingres Woessss...."
- Previous message: sivaPrakash: "Re: JDBC Connection Problem "CLASSNOTFOUNDEXCEPTION" in TomCat"
- Next in thread: Lothar Kimmeringer: "Re: JDBC to Ingres Woessss...."
- Reply: Lothar Kimmeringer: "Re: JDBC to Ingres Woessss...."
- Reply: Real Gagnon: "Re: JDBC to Ingres Woessss...."
- Reply: Dave Bender: "Re: JDBC to Ingres Woessss...."
- Reply: bevyn quiding: "Re: JDBC to Ingres Woessss...."
- Reply: bevyn quiding: "Re: JDBC to Ingres Woessss...."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|