Re: JDBC connection failure
От | Robert B. Easter |
---|---|
Тема | Re: JDBC connection failure |
Дата | |
Msg-id | 0101272142420Z.08820@comptechnews обсуждение исходный текст |
Ответ на | Re: JDBC connection failure (Jeff Duffy <jduffy@greatbridge.com>) |
Список | pgsql-general |
Here is a little example I played with that worked fine: <%@ page info="Example JSP pre-compiled" import="java.io.*,java.sql.*,java.text.*" %> <html> <head> <title>Java-Test: hello</title> <body> <%! Connection db; Statement st; ResultSet rs; %> <TABLE BORDER=1> <TR><TH>uname</TH><TH>email</TH></TR> <% Class.forName("org.postgresql.Driver"); db = DriverManager.getConnection("jdbc:postgresql:databasename", "username", "password"); st = db.createStatement(); rs = st.executeQuery("SELECT * FROM users"); while(rs.next()) { %> <TR><TD><%= rs.getString("uname") %></TD><TD><%= rs.getString("email") %></TD></TR> <% } %> </TABLE> </body> </html> <% rs.close(); st.close(); db.close(); %> reaster@comptechnews:~/web/java-test$ echo $CLASSPATH .:/usr/local/lib/java/postgresql.jar On Saturday 27 January 2001 12:06, Jeff Duffy wrote: > On Sat, 27 Jan 2001, Culley Harrelson wrote: > > Hi, > > > > I'm pulling my hair out trying to establish a jdbc > > connection to postgresql. The error I recieve is: > > > > unable to load class postgresql.Driver > > The documentation had a typo. The driver class is org.postgresql.Driver > (see the devel docs). -- -------- Robert B. Easter reaster@comptechnews.com --------- -- CompTechNews Message Board http://www.comptechnews.com/ -- -- CompTechServ Tech Services http://www.comptechserv.com/ -- ---------- http://www.comptechnews.com/~reaster/ ------------
В списке pgsql-general по дате отправления: