From: | "Ashok(dot)(dot)(dot)(dot)(dot)(dot)" <kasreenivasulu(at)yahoo(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Arjunt...... |
Date: | 2004-10-01 17:01:18 |
Message-ID: | 20041001170118.35886.qmail@web11905.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
hi!
Everybody.
I have written a code to connec to postgre sql
databse.But i am geting some error.
import java.sql.*;
import java.util.*;
import java.lang.*;
public class LoginPage {
public static void main(String[] args)
{
Connection conn;
try
{
Class.forName("org.postgresql.Driver");
String url =
"jdbc:postgresql://localhost:5432/test";
conn = DriverManager.getConnection(url,
"postgres", "viwotec");
Statement s = conn.createStatement();
ResultSet r = s.executeQuery("select
oid,id,name,password from myschema.login");
while( r.next() )
{
int id = r.getInt(2);
System.out.println("Row " + id + ":");
int oid = r.getInt(2);
System.out.println("Rowoid " + oid + ":");
/*String nam = r.getString();
System.out.println("Name of the person" + nam
+ ":");
String pass = r.getString();
System.out.println("Password you entered was"
+ pass + ":"); */
}
s.close();
conn.close();
}
catch( Exception e )
{
e.printStackTrace();
}
}
}
and the error is
java.lang.ClassNotFoundException:
org.postgresql.Driver
at
java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at
java.security.AccessController.doPrivileged(Native
Method)
at
java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at LoginPage.main(LoginPage.java:14)
please tell me solution for this...How i can load the
driver and where
--- Shachar Shemesh <shachar(at)lingnu(dot)com> wrote:
> pwbyrne(at)hotmail(dot)com wrote:
>
> >Hi,
> >
> >I'm looking for details, or tools about porting a
> full Ms Sql Server
> >2000 database to Postgres on Linux.
> >
> >Is this possible? We have the whole nine yards,
> stored procedures,
> >triggers, and all.
> >
> >Is there a way to automate this process?
> >
> >Thanks
> >
> >
> Totally automate - no.
>
> There are tools to help you along, however. They
> are not as complete as
> I would like them, and I need lots of help in
> maintaining the site. It's
> located at http://pgfoundry.org/projects/sql2pg/,
> but there are
> currently no released files. In CVS, however, you
> will find a perl
> script that translates the exported database
> description from MS SQL to
> a more-or-less PG friendly format. Also you will
> find there support for
> two data types - varcharci (case insensitive) and
> utinyint (1 byte
> unsigned integer).
>
> Any help with maintaining this project would be
> greatly appreciated.
>
> I do have a few questions for you. What drivers do
> you currently use to
> access your database? Do you use the stored
> procedure's ability to
> return more than one result?
>
> Shachar
>
> --
> Shachar Shemesh
> Lingnu Open Source Consulting ltd.
> http://www.lingnu.com/
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please
> send an appropriate
> subscribe-nomail command to
> majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list
> cleanly
>
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
From | Date | Subject | |
---|---|---|---|
Next Message | Jean-Luc Lachance | 2004-10-01 17:13:33 | Re: Random not so random |
Previous Message | sklassen | 2004-10-01 16:49:23 | Re: Postgresql commands to display all functions and process/connections based on a database. |