This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
(1) Just trying to test the insert method within my DAO. the method will insert mostly Strings and Integers, but a few Dates also. I checked the API for java.sql.Date, and it says to pass in a long Date. So I used a millisecond to Date converter and generated a number from a date. However, the compiler rejected the number, as it was too big.
So now, I just passed in a new GregorianCalendar(106, 11, 15).getTime() instead. Will this work?
(2) I am a bit new to writing DAO classes, so just had a question on testing insert statements:
In order for an insert to work, do the fields in your query statement have to be in the exact same order as in the table? I am not hardcoding in values in the query, as these will come from getter methods from another class.
So, for example, i have: "INSERT INTO MYTABLE (COL1, COL2, COL3)" + "VALUES(?, ?, ?)";