Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: [Q]:SQL Oracle - Java (via JDBC)

Re: [Q]:SQL Oracle - Java (via JDBC)

From: Ramesh Rajagopal <rameshr_at_asymetrix.com>
Date: 1997/04/17
Message-ID: <335657F9.56AD@asymetrix.com>#1/1

You don't seem to be passing the user name and password in your call to getConnection.

    Connection conn =
> DriverManager.getConnection("jdbc:oracle:pepeillo/suclave");
>

You should be doing something like:

    Connection conn =
> DriverManager.getConnection("jdbc:oracle:pepeillo/suclave", "myusername", "mypassword");
>

Of course, you should replace myusername and mypassword with your login name and password.

Hope this helps.

Ramesh Rajagopal.
Asymetrix Corporation.

Montse Collados Polidura wrote:
>
> Hello,
>
> I've installed the driver "Oracle's JDBC/OCI7" and i follow the
> exemple given. When i load the driver (Class.forName
> ("oracle.jdbc.OracleDriver")), that's ok; but after that, when i try to
> connect to the database ( Connection conn =
> DriverManager.getConnection("jdbc:oracle:pepeillo/suclave");
> ) it gives the next error: "java.sql.SQLException: ORA-07268:
> szguns:
> getpwuid error."
>
> The login and password that i use, they are ok because when i
> make the connection directly, it works fine.
> Please, it's urgent. If you can help me, send me an e-mail.
>
> Thank you in advance.
>
> The code:
>
> public class JavaSql
> {
>
> public static void main(String arg[])
> {
>
> System.out.println ("Loading Oracle JDBC OCI driver");
> try
> {
> Class.forName ("oracle.jdbc.OracleDriver");
> }
> catch (ClassNotFoundException e)
> {
> System.out.println ("Could not load the driver");
> e.printStackTrace ();
> }
> System.out.println ("Connecting to the local database");
> try {
> Connection conn =
> DriverManager.getConnection("jdbc:oracle:pepeillo/suclave");
> }catch (SQLException s){System.out.println(s);};
>
> }}
>
> I am using a local database.
>
> Solaris 2.4 and Oracle 7.2.3.0.0
>
> -------------------------------------
>
> Montse Collados Polidura
>
> e-mail: montse_at_lia.univ-savoie.fr
> x4260273_at_turing.ugr.es
>
> "Si lloras porque no puedes ver el sol,
> las lagrimas te impediran ver las estrellas"
Received on Thu Apr 17 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US