|
INTERVIEW QUESTIONS
J2EE
JDBC
DETAILS
Question: How can I tell if my JDBC driver normalizes java.sql.Date and java.sql.Time objects?
Answer: To actually determine the values, the objects must be converted to a java.util.Date and examined. See What does normalization mean for java.sql.Date and java.sql.Time? for the definition of normalization. Notice that even a debugger will not show whether these objects have been normalized, since the getXXX methods in java.sql.Date for time elements and in java.sql.Time for date elements throw an exception. So, while a java.sql.Date may show 2001-07-26, it's normalized only if the java.util.Date value is: Thu Jul 26 00:00:00 EDT 2001 and while a java.sql.Time may show 14:01:00, it's normalized only if the java.util.Date value is: Thu Jan 01 14:01:00 EST 1970
|
|
|
Category |
JDBC Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 6653 users |
Added on |
9/12/2014 |
Views |
71710 |
Rate it! |
|
|
Question:
How can I tell if my JDBC driver normalizes java.sql.Date and java.sql.Time objects?
Answer:
To actually determine the values, the objects must be converted to a java.util.Date and examined. See What does normalization mean for java.sql.Date and java.sql.Time? for the definition of normalization. Notice that even a debugger will not show whether these objects have been normalized, since the getXXX methods in java.sql.Date for time elements and in java.sql.Time for date elements throw an exception. So, while a java.sql.Date may show 2001-07-26, it's normalized only if the java.util.Date value is: Thu Jul 26 00:00:00 EDT 2001 and while a java.sql.Time may show 14:01:00, it's normalized only if the java.util.Date value is: Thu Jan 01 14:01:00 EST 1970 Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What is pessimistic concurrency?
|
View Answer
|
|
What is optimistic concurrency?
|
View Answer
|
|
Which Java and java.sql data types map to my specific database types?
|
View Answer
|
|
Does the database server have to be running Java or have Java support in order for my remote JDBC client app to access the database?
|
View Answer
|
|
What is a JDBC 2.0 DataSource?
|
View Answer
|
|
Can I use JDBC to execute non-standard features that my DBMS provides?
|
View Answer
|
|
How can I get information about foreign keys used in a table?
|
View Answer
|
|
How can I determine where a given table is referenced via foreign keys?
|
View Answer
|
|
What are the considerations for deciding on transaction boundaries?
|
View Answer
|
|
How to insert/update records with some of the columns having NULL value?
|
View Answer
|
|
Why do I get UnsatisfiedLinkError when I try to use my JDBC driver?
|
View Answer
|
|
How do I check in my code whether a maximum limit of database connections have been reached?
|
View Answer
|
|
What is the JDBC syntax for using a literal or variable in a standard Statement?
|
View Answer
|
|
How do I set properties for a JDBC driver and where are the properties stored?
|
View Answer
|
|
What is an SQL Locator?
|
View Answer
|
|
Why do I have to reaccess the database for Array, Blob, and Clob data?
|
View Answer
|
|
What does it mean to "materialize" data?
|
View Answer
|
|
How can I get or redirect the log used by DriverManager and JDBC drivers?
|
View Answer
|
|
How can I write to the log used by DriverManager and JDBC drivers?
|
View Answer
|
|
How do I receive a ResultSet from a stored procedure?
|
View Answer
|