0

I had experience with mysql before, but know completely nothing about Oracle DB.

Recently, I'm assigned to add a simple feature to an existing system.
Albeit simple, I need to connect to the db and get some knowledge about the existing database. But I simply don't know how to do that. I have ssh access with su privilege on a debian remote machine that can connect to the database server.

Below is the java code I received that should be db accessing part. I think it might help you understand my problem (I'm a really a newbie):

        String url = "jdbc:oracle:thin:@aaa.bbb.ccc.ddd:port/price";
        Properties info = new Properties();
        info.setProperty("user", "username");
        info.setProperty("password", "password");

So, how can I connect to Oracle db from linux command line?

Haozhun
  • 257
  • 2
  • 5
  • 10

2 Answers2

3

Use sqlplus. SQLPlus FAQ, SQLPlus Documentation

alvosu
  • 8,357
  • 24
  • 22
0

The code you've provided is not intended to be run from the shell - it looks java.

SQLPlus is the usual client used for interacting with an Oracle DBMS from a terminal session - but IIRC its not bundled in the basic instant client package. There are lots of other tools which you could use. If you want an interactive client runing in a terminal session, you could use sqlplus, or gqlplus (which has better curses integration). There's also pysql, yasql.

There's lots and lots of GUI clients (and because they run on the XWindow system, running them on a remote display is trivial) including Tora and SQLDeveloper.

symcbean
  • 19,931
  • 1
  • 29
  • 49
  • Thanks. Yes, its java. I provided it here just in case I had misunderstanding on the basics of database. If so, you may point it out as I posted the code. – Haozhun Jan 27 '11 at 14:49
  • I got sqlplus by installing Oracle XE Client 10. – Haozhun Jan 27 '11 at 14:50