Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

i have problem with a connection on Oracle RDBMS

7 views
Skip to first unread message

REM

unread,
Sep 6, 2001, 2:44:14 PM9/6/01
to
with try connection on a Oracle i get some errors:

java.sql.SQLException: Exceding key size
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:420)
at oracle.jdbc.ttc7.O3log.<init>(O3log.java:255)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:166)
at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:93)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:147)
at java.sql.DriverManager.getConnection(DriverManager.java:91)
at java.sql.DriverManager.getConnection(DriverManager.java:134)
at JdbcTest.main(JdbcTest.java:23)

my source code is:

import java.sql.*;
import java.util.*;
import java.io.*;
import java.lang.*;
import java.net.*;
import oracle.jdbc.driver.*;

class JdbcTest {
public static final String DRIVER_NAME = "oracle.jdbc.driver.OracleDriver";
public static final String DATABASE_URL =
"jdbc:oracle:thin:@host_name:1521:SID";

public static void main (String args []) throws ClassNotFoundException,
SQLException {


Class.forName (DRIVER_NAME);
System.out.println("Connection...");

Connection conn =DriverManager.getConnection (DATABASE_URL, "user_name",
"password");

System.out.println("Connection make!");

Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery ("SELECT gsm FROM korisnik");

while (rset.next ())
System.out.println (rset.getString (1));

rset.close();
stmt.close();
conn.close();
}
}

where i make mistake??
--
Pozdrav,

ilica

_________

"Computers are useless. They can only give you answers."


Greg Sill

unread,
Sep 7, 2001, 9:00:06 PM9/7/01
to
You are not specifying the correct values in your connection strings
and database URL. The host_name in the URL should be the name of your
database server and the SID in the name of the database instance. You
have to replace the values in the string to the correct values for the
connection. Then in the getConnection method you need to actually
specify what is the user name and password to connect.

Examples.
"jdbc:oracle:thin:@server1:1521:MyDB";
getConnection (DATABASE_URL, "scott","tiger")

where my database is called MyDB which resides on server1 and I have a
user scott with password tiger.


"REM" <ilica....@zg.hinet.hr> wrote in message news:<9n8g3f$89f1$1...@as201.hinet.hr>...

REM

unread,
Sep 8, 2001, 9:02:34 AM9/8/01
to
but in really code I'm put right name of the host and name od SID instance.
I take this values of the TNS file.

"Greg Sill" <greg...@ingenix.com> wrote in message
news:175a1a24.01090...@posting.google.com...

0 new messages