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:postgresq l://localhost:5432/test";
conn = DriverManager.g etConnection(ur l,
"postgres", "viwotec");
Statement s = conn.createStat ement();
ResultSet r = s.executeQuery( "select
oid,id,name,pas sword from myschema.login" );
while( r.next() )
{
int id = r.getInt(2);
System.out.prin tln("Row " + id + ":");
int oid = r.getInt(2);
System.out.prin tln("Rowoid " + oid + ":");
/*String nam = r.getString();
System.out.prin tln("Name of the person" + nam
+ ":");
String pass = r.getString();
System.out.prin tln("Password you entered was"
+ pass + ":"); */
}
s.close();
conn.close();
}
catch( Exception e )
{
e.printStackTra ce();
}
}
}
and the error is
java.lang.Class NotFoundExcepti on:
org.postgresql. Driver
at
java.net.URLCla ssLoader$1.run( URLClassLoader. java:199)
at
java.security.A ccessController .doPrivileged(N ative
Method)
at
java.net.URLCla ssLoader.findCl ass(URLClassLoa der.java:187)
at
java.lang.Class Loader.loadClas s(ClassLoader.j ava:289)
at
sun.misc.Launch er$AppClassLoad er.loadClass(La uncher.java:274 )
at
java.lang.Class Loader.loadClas s(ClassLoader.j ava:235)
at
java.lang.Class Loader.loadClas sInternal(Class Loader.java:302 )
at java.lang.Class .forName0(Nativ e 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 <sh*****@lingnu .com> wrote:
pw*****@hotmail .com wrote:Hi,
I'm looking for details, or tools about porting a
full Ms Sql Server2000 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
ma*******@postg resql.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
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly