SQL *plus command >>>> NEED HELP :)

SFR

Truth fears no questions
One said:
SFR ..

I didn't get your point.

I want to get the info that supply by DESC command( fields name and datatype)


Code:
statement = con.createStatement();
 
String selectQuery = "SELECT * FROM STUDENT" ;
 
ResultSet resultSet = null ;

if you change the SELECT * FROM STUDENTS to DESC STUDENTS...


here is an example of what is returned if I type DESC ALLOC at work:

Code:
SQL> desc alloc
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 DELIVERY                                  NOT NULL VARCHAR2(30)
 ITEM_NUMBER                               NOT NULL VARCHAR2(40)
 DESCRIPTION                               NOT NULL VARCHAR2(50)
 LOCATION                                  NOT NULL VARCHAR2(9)
 QUANTITY                                  NOT NULL NUMBER(6)
 MASTER_ORDER_NUMBER                                VARCHAR2(30)
 ALT_LOC_RACK                                       VARCHAR2(9)
 RACK_SHORT_ENTERED                                 NUMBER(1)


YOUR syntax for QueryTable is all correct.... but I do not know if - through the oracle jdbc driver - you can run the sql statement: desc STUDENTS instead of SELECT * FROM STUDENTS
 

One

New Member
SFR ..

Yeah, this is exacutly what i want. I got this result when I executed the command direct from my oracle account. It doesn't work with me in java code althought the connection is being successfully to the databace!
 
Last edited:

Cromewell

Administrator
Staff member
Yopu might want to try "show columns from <table>;" instead, I'm not sure if that will work though. The jdbc should just dump sql commands to the sql engine and wait for output but with java you never know what foolish thing sun might be trying to do in there.
 

dragon2309

P.I Dragon
aaah right, now at least i get what you were trying to do, ididnt understand at first, try asking sun themselves, they designed the thing, lol

dragon
 

One

New Member
Cromewell said:
Yopu might want to try "show columns from <table>;" instead, I'm not sure if that will work though. The jdbc should just dump sql commands to the sql engine and wait for output but with java you never know what foolish thing sun might be trying to do in there.


I will try it Cromewell.. hope it is ganna work .. Thanks so much :)

---
dragon2309 said:
aaah right, now at least i get what you were trying to do, ididnt understand at first, try asking sun themselves, they designed the thing, lol

Oh yeaaaaaah, sorry my explaination was poor
what I am ganna to do is killing myself dragon.. I feel tired asking about this problem :eek:


------

Anyhow, I would like to thank you all guys, I appreciate your time

dragon2309
Dubai_
Cromewell
& SFR

Thanxx again .. you were very cooperative :eek:
 
Top