Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Piet Souris

Why Statemet interface is not Deprecated ?

Posts: 16
  • Mark post as helpful
  • send pies
  • Report post to moderator
Can any one please tell me that why Statement interface in java.sql package is not Deprecated as all fuctionality are provided with PreparedStatment?
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Report post to moderator
Don't forget

Fields inherited from interface java.sql.Statement


Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout

If you compare e.g. PreparedStatement.addBatch with Statement.addBatch you will find they are not identical.
[ November 29, 2006: Message edited by: �dne Brunborg ]
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Report post to moderator
Also, Statement is still a perfectly valid interface. In fact, if you have a set statement, that is not dependant on a lot of variables to create, does not use user input (which could introduce SQL injection attacks), and is not going to be run mulitple times in succession, then Statement is actually preferable to PreparedStatement.
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't post the same question in multiple forums. It creates duplicate conversations and wastes the time of the people trying to help you.

No more fooling around. Read this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!