OK. It just got weirder on the JDBC question. the following code works(not a
servlet).
Does this mean that Jserv is somehow causing a problem?
==CODE====================================================
import java.sql.*;
public class test {
public static void main(String argv[])
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:webstore";
Connection con =
(Connection)DriverManager.getConnection(url,"test","testme");
Statement stmt = con.createStatement();
String queryString = "SELECT * FROM addresslist WHERE ID
= 'sg';";
ResultSet rs = stmt.executeQuery(queryString);
while(rs.next())
{
System.out.println(rs.getString("name"));
}
System.out.println(queryString);
stmt.close();
con.close();
}
catch (Exception ex)
{
System.out.println(ex);
}
}
}
Noah Nordrum wrote:
> tried that, but I got a different error.
>
> Message: No data found
> SQLState: null
> ErrorCode: 0
> SELECT * FROM addresslist WHERE ID = 'sg';
>
> ARRGGGG I HATE WINDOWS!!!!
>
> lichtner wrote:
>
> > On Sat, 29 May 1999, Noah Nordrum wrote:
> >
> > > stmt = (Statement)con.createStatement();
> > > rs = (ResultSet)stmt.executeQuery(queryString);
> > > if (rs.getString("name") == null) // <--------- Bombs out right here
> >
> > I usually place an 'rs.next()' before the first rs.getXXX.
> > I don't remember if that is the spec, but ever since I started
> > doing JDBC I always have
> >
> > if (rs.next()) {...}
> >
> > or
> >
> > while (rs.next()) {...}
> >
> > Are you going to f**k me now :-) ?
> >
> > ----------------------------------------------
> > Guglielmo Lichtner (212) 799-2551
> >
> > "Your quote here."
> > - B.Stroustrup
> >
> > -- --------------------------------------------------------------
> > To subscribe: [EMAIL PROTECTED]
> > To unsubscribe: [EMAIL PROTECTED]
> > READ THE FAQ!!!! <http://java.apache.org/faq/>
> > Archives and Other: <http://java.apache.org/main/mail.html/>
> > Problems?: [EMAIL PROTECTED]
>
> --
> ==============================================================
> Noah Nordrum
> [EMAIL PROTECTED]
> http://www.newfrenchbakery.com/
> 1:24pm up 156 days 18:35 hours
> ==============================================================
>
> -- --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> READ THE FAQ!!!! <http://java.apache.org/faq/>
> Archives and Other: <http://java.apache.org/main/mail.html/>
> Problems?: [EMAIL PROTECTED]
--
==============================================================
Noah Nordrum
[EMAIL PROTECTED]
http://www.newfrenchbakery.com/
3:24pm up 156 days 20:35 hours
==============================================================
-- --------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]