wood burning stoves 2.0*
The moose likes JDBC and the fly likes Welcome R.M. Menon! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Welcome R.M. Menon!" Watch "Welcome R.M. Menon!" New topic
Author

Welcome R.M. Menon!

Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

This week we have a special guest in the JDBC forum: R. M. Menon, the author of the new book Expert Oracle JDBC Programming. He'll be here until Friday answering questions about the book and about programming for Oracle with JDBC. We'll also be giving away four copies of the book to four luck posters. See for contest rules.


Go ahead, c'mon in, start a new thread, and ask him a question; but be sure to wipe the mud off'n yer boots, first.


[Jess in Action][AskingGoodQuestions]
R. M. Menon
Author
Ranch Hand

Joined: Mar 15, 2006
Posts: 50
Hi folks
This is R. M. Menon, the author mentioned in the above post. Please feel free to ask your questions about the book. Typically, I will answer them at the end of the day.

Thank you!

Menon
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
*cough*

http://www.javaranch.com/name.jsp


"separate [rules] are inherently unequal." - Supreme Court of the United States - Brown v. Board of Education
Bill Johnston
Ranch Hand

Joined: Nov 17, 2005
Posts: 201
Your book is specifically about JDBC for Oracle databases, I see. Since Oracle is the DB I regularly deal with professionally, I would like to ask you if you discuss in detail the preferred drivers to be used with the different Oracle versions. There is soon to be an upgrade to 10i where I work, and I am curious as to any changes in this regard.

Also, If I may be so bold, I would like to ask you a question about Statements. I've noted that some well respected programmers advocate closing all Statements explicitely, in addition to explicitely closing the Connection.

In my own experience with working on Oracle DBs, when submitting many different queries (executing many Statements), closing the Statements explicitely after each and everyone sometimes breaks the application; whereas not doing so for all intents and purposes gives every indication of working smoothly. Closing the Connection explicitely is not an issue.

May I have your own opinion on this?


~Bill
R. M. Menon
Author
Ranch Hand

Joined: Mar 15, 2006
Posts: 50
Your book is specifically about JDBC for Oracle databases, I see. Since Oracle is the DB I regularly deal with professionally, I would like to ask you if you discuss in detail the preferred drivers to be used with the different Oracle versions. There is soon to be an upgrade to 10i where I work, and I am curious as to any changes in this regard.



Yes this topic is dealt with specifically. Going forward in most cases (in 10G (not 10i), you should be using the thin driver.


Also, If I may be so bold, I would like to ask you a question about Statements. I've noted that some well respected programmers advocate closing all Statements explicitely, in addition to explicitely closing the Connection.

In my own experience with working on Oracle DBs, when submitting many different queries (executing many Statements), closing the Statements explicitely after each and everyone sometimes breaks the application; whereas not doing so for all intents and purposes gives every indication of working smoothly. Closing the Connection explicitely is not an issue
May I have your own opinion on this?


I am not sure what "problems" you refer to when closing statmenets explicitly. Yes, if you prepare a PreparedStatement and close it in a loop, you would run into performance issues - this topic is covered in detail in the book. You can use statement caching to resolve this issue "transparently" in JDBC 3.0. (There is a chapter for statement caching in the book.)

Btw, almost all cases you should be using PreparedStatement or CallableStatement for an DMLs..

Also, you can get a flavor of the book by looking at the sample chapters at OTN (you do have to register - but it is worth it as this is the place where all Oracle documentation is freely available):
http://www-portal-stage.oracle.com/wocportal/page/wocprod/OCOM/technology/books/files/menon_ch.zip


Hope this helps...
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Originally posted by Maximilian Stocker:
*cough*


First initials are not encouraged, but are allowed.
Bill Johnston
Ranch Hand

Joined: Nov 17, 2005
Posts: 201
Thank you for your reply. Your book sounds like a worthwhile read. The reason I am not using PreparedStatements for 'the' particular application I refer to is because it is basically an SQL-Plus kind of application that allows free form on the fly SQL query entry and is not part of a production run 'series' of SQLs statements. Otherwise, in other applications I do use PreparedStatements often.

~Bill
R. M. Menon
Author
Ranch Hand

Joined: Mar 15, 2006
Posts: 50
Thank you for your reply. Your book sounds like a worthwhile read. The reason I am not using PreparedStatements for 'the' particular application I refer to is because it is basically an SQL-Plus kind of application that allows free form on the fly SQL query entry and is not part of a production run 'series' of SQLs statements. Otherwise, in other applications I do use PreparedStatements often.

~Bill



Even here you may wanna use prepared statements for security reasons (think SQL Injection). It also depends on if the same query is submitted with different bind variable values or not. Personally, I don't see any reason for using Statement when working with DMLs (unless you specifically dont want to bind variables for very well understood reasons.)
I cover this topic in the sample chapters at Otn link to which I posted earlier (see chapter 5 in the two chapters.)
Bill Johnston
Ranch Hand

Joined: Nov 17, 2005
Posts: 201
In my case, as I said the SQL is totally free-form. One SQL is:

select tableA.field_b
from tableA
where tableA.field_a in ('01', '02', '03')
and trunc(tableA.activity_date) = trunc(sysdate-1);

... And the next SQL is:

select max(to_char(tableZ.doc_number,'99999990')),
tableZ.doc_name
from tableZ
where tableZ_year = '2006'
and tableZ_doc_type = 'B'
group by tableZ.doc_name
order by tableZ.doc_name;

... and so on. Just as one would in SQL-Plus.
R. M. Menon
Author
Ranch Hand

Joined: Mar 15, 2006
Posts: 50
Well, SQL PLus allows you to use bind variables too If I may ask why this application was built in the first place?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Hey kids --

To ask a question, please start your own thread; questions in this thread don't count as entries in the book giveaway!
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30146
    
150

Welcome Menon! I hope you have a good week here.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Bill Johnston
Ranch Hand

Joined: Nov 17, 2005
Posts: 201
"Hey kids --

To ask a question, please start your own thread; questions in this thread don't count as entries in the book giveaway!"

It started out as a question about the book - about what he has in the book about closing statements ... at least in my mind that was a question about the book. I assure you that I did not mean to digress ... it just happened. I did not think that it was proper to ignore his questions. But, okay I stopped ... unless he asks more. Best regards,

~Bill
R. M. Menon
Author
Ranch Hand

Joined: Mar 15, 2006
Posts: 50
"To ask a question, please start your own thread; questions in this thread don't count as entries in the book giveaway!"

Well, how would I know that a thread is meant for me - I thought I have to watch just this "thread"

And Thanx Jeanne - I should havea good time here..

Menon
angelo celeste
Ranch Hand

Joined: Mar 21, 2001
Posts: 73
Hi R. M.
The link that you supplied above does not work for me.
http://www-portal-stage.oracle.com/wocportal/page/wocprod/OCOM/technology/books/files/menon_ch.zip
I have logged onto OTN and cannot locate this anywhere. I have tried directly and through Oracle. Also did a search for your name....no luck.

Any suggestions?

Thanks.
Bill Johnston
Ranch Hand

Joined: Nov 17, 2005
Posts: 201
The link does not work for me either. And just to answer your last question and then leave it for now ... the reason I coded up the application was simply to have an app tailer fitted to my needs w/o frills I do not want and with add-ons that I do. Thanks for your replies.

I want to ask you additional questions about your book after reviewing it, if I may. Best regards,

~Bill
R. M. Menon
Author
Ranch Hand

Joined: Mar 15, 2006
Posts: 50
Thanx guys.

The link is not working for me either now - some issue with otn, I guess.

You can get the same chapters from the bookpool site:

http://www.bookpool.com/sm/159059407X

Hope this helps...
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Ernest,
A book promotion, that's cool.

What happened to the last one ? (Ajax Patterns)


[My Blog]
All roads lead to JavaRanch
Bill Johnston
Ranch Hand

Joined: Nov 17, 2005
Posts: 201
Reading it ... so far, very interesting. No more questions yet though. ;o)
Bill Johnston
Ranch Hand

Joined: Nov 17, 2005
Posts: 201
Why do you:

... instead of:

?
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

Welcome to our fine forum. We'll do our best to make you feel cozy and comfortable here. This is great, becuase I actually have a question or two about the Oracle JDBC driver -- but you'll find my questions in their own thread.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Bill Johnston
Ranch Hand

Joined: Nov 17, 2005
Posts: 201
Alright, I ask in ignorance ... now I am confused. The opening post reads: "... He'll be here until Friday answering questions about the book and about programming for Oracle with JDBC ... ".

Yet you just said: "I actually have a question or two about the Oracle JDBC driver -- but you'll find my questions in their own thread."

Isn't that splitting hairs? Please explain ... I don't to make any more faux pas ;o)
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

"He'll be here" means that he'll be at the JDBC forum.
If everybody sends questions in a single thread, this will be a complete mess, won't it ?
So please start a new thread when you have a question.
Bill Johnston
Ranch Hand

Joined: Nov 17, 2005
Posts: 201
Stupid me - id took no note of this on the first post:
"Go ahead, c'mon in, start a new thread, and ask him a question; but be sure to wipe the mud off'n yer boots, first."

Forgive me please, I am new here and this moderated forum is not at all unpleasant, just different from what I am used to.

Thanks for your kind reply; best regards,

~Bill
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

's OK, Bill. No worries!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Welcome R.M. Menon!
 
Similar Threads
I'm new to oracle database, sql
Help choosing between two books
Expert Oracle JDBC Programming by R. M. Menon
Java Programming with Oracle JDBC by Donald K. Bales, Don Bales
Making the choice of RDBMS configurable