aspose file tools*
The moose likes JDBC and the fly likes SQLJ vs JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQLJ vs JDBC" Watch "SQLJ vs JDBC" New topic
Author

SQLJ vs JDBC

robyne vaughn
Ranch Hand

Joined: Jun 04, 2003
Posts: 38
I'm new to Java and want to do some database manipulation. What are the advantages of using either SQLJ or JDBC? I've been working with JDBC a little and wonder if there is some kind of buffer limit on bytes returned from the database using a prepared statement. I wonder if I should change my focus and consider SQLJ.
I'm trying to develop a web application. j2ee.
What do I consider when trying to make a choice?
thanks,
:roll:
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9047
    
  10
moving to the JDBC forum


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Sujatha Ranganathan
Greenhorn

Joined: May 29, 2003
Posts: 12
Hi,
You may want to have a look at the JDBC & SQLJ documentation on OTN
JDBC - http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/toc.htm
SQLJ - http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96655/toc.htm
JDBC & SQLJ Sample code available at http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/content.html
Sujatha.
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1134

Hi Robyne,
As far as I know, SQLJ is just one more level of abstraction. You write "embedded" SQL in your java code, which then gets translated into JDBC code. So the only difference (as far as I can tell) is ease of coding. I imagine some people would prefer to write embedded SQL rather than JDBC code directly.
Hope this has helped you.
Good Luck,
Avi.
Nitin Parashar
Ranch Hand

Joined: Jun 06, 2003
Posts: 52
The main difference between JDBC and SQLJ is that while JDBC provides access through dynamic SQL, SQLJ provides access through embedded static, SQL. Thus the traditional benefits of static SQL for Java language programs are all provided by SQLJ.


SCJP 1.4, SCWCD 1.4, SCBCD 1.3
robyne vaughn
Ranch Hand

Joined: Jun 04, 2003
Posts: 38
Thanks so much. You all offered good suggestions and information.
rob
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I will chime in here in recommend using Hibernate.
This allows you to get away from SQL totally if you want to and concentrate on your application rather than debugging SQL statements. I have just started using it over the past few days and I am pretty impressed. Plus, they just released their Version 2. So it's hot off the press. Another bonus: Open Source and FREE.


GenRocket - Experts at Building Test Data
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQLJ vs JDBC