aspose file tools*
The moose likes JDBC and the fly likes Database  question??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Database  question???" Watch "Database  question???" New topic
Author

Database question???

darine darine
Ranch Hand

Joined: Mar 08, 2001
Posts: 43
Hi
I have installed oracle on my c:\ drive and created database for example of name 'abc'.
now when i go to sqlplus editor and create
a table 'customers' and i do desc command i see all its columns,the question is: is that table 'customers' now in that database 'abc'?
How do i know that?is there a sql statement to show me all tables in that database 'abc'?(sample code plz).
I'm sure i can create many databases too other than 'abc' ...is that right?
To connect to 'abc' is database url should be like the following:
"jdbc racle:thin@localhost:1521:abc"
is that right?
Thanks for your time.
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 566
Somebody jump in here and correct me if I'm wrong but in Oracle the databases are actually namespaces and they are defined by the owner. So to see all tables in one namespace, you can query the all_tables view:
SELECT table_name FROM all_tables
WHERE owner = 'adam'


I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
Mahesh Mamani
Ranch Hand

Joined: Jun 25, 2001
Posts: 110
hi,
The sql statement is "select * from tab"

MSM
Murali Obla
Ranch Hand

Joined: Nov 18, 2001
Posts: 40
Hi,
Try this query
"connect username/password @database name".
Then type "select * from tab".It will show u the tables available in that database.
Regards,
Murali


"Excellence is never an accident; it is always the result of high intention, sincere effort, intelligent direction, skillful execution, and the vision to see obstacles as opportunities"
Monty Ireland
Ranch Hand

Joined: Oct 03, 2000
Posts: 161
Search this form for code examples.
I have posted Oracle, DB2, CloudScape, and MS-Access examples.
Search this form for Monty or Monty6
Start you search around Sept of 2001
You may have to go back about 6 to 12 months.
You should be able to find the anser to your question(s) in one of my code fragments.
Hope this helps


Multi Platform Database Developer & DBA on E.S.T.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Database question???