where can i get a good jdbc driver for MS SQL 2000?
-----Original Message----- From: Gary Gesmundo [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 2:26 PM To: JDJList Subject: [jdjlist] Re: sql Date Emmanuel, You will need to switch to a JDBC driver to do any serious work with SQL Server. We support Oracle, MS SQL and Sybase from our application and found early on that the JDBC-ODBC bridge is not suitable for any real DB manipulation. I have not used it in a while, but earlier research found the bridge not to be able to support multiple users doing updates to a DB. In addition the bridge did not support all of the JDBC features. Regards, Gary ----- Original Message ----- From: "Emmanuel Eze" <[EMAIL PROTECTED]> To: "JDJList" <[EMAIL PROTECTED]> Sent: Tuesday, May 07, 2002 7:12 AM Subject: [jdjlist] Re: sql Date > I get the error message when i use the prepared statement: > [Microsoft][ODBC SQL Server Driver]Optional feature not implemented > > I am connecting to an MS SQL Server 2000 using JDBC-ODBC brige. > > -----Original Message----- > From: Shi Zili [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 07, 2002 11:29 AM > To: JDJList > Subject: [jdjlist] Re: sql Date > > > Use method prepareStatement of Class Connection to create statement instead > of createStatement > > PreparedStatement pstmt = con.prepareStatement("INSERT INTO > LOG(logtime,event) values (?,?)"); > > java.sql.Date sqlDate = new java.sql.Date(birthday.getTime()); > String message = ....; > > after you can pass sqlDate as parameter to the statement through method > setDate > > pstmt.setDate(1, sqlDate ); > pstmt.setString(2, message ); > > Now, > pstmt.executeUpdate(); > > to insert this record to table > > > > > java.sql.Date sqlDate = new java.sql.Date(birthday.getTime()); > > > > and to pass it as parameter of the setDate(java.sql.Date) method > > > > ----- Original Message ----- > > From: "Emmanuel Eze" <[EMAIL PROTECTED]> > > To: "JDJList" <[EMAIL PROTECTED]> > > Sent: Tuesday, May 07, 2002 11:03 AM > > Subject: [jdjlist] sql Date > > > > > > > Hi all, > > > > > > Can somebody pls tell me how I can insert a Date type into a database > > table > > > with a Date datatype? > > > > > > I have the year, month, and day as interger values. I need to convert > > these > > > values into an sql Date object so I can now insert the Date object into > > the > > > table, right? > > > > > > I have the folllowing code: > > > Calendar cbirthday = null; > > > java.util.sql birthday = null; > > > . > > > . > > > . > > > cbirthday = Calendar.getInstance(); > > > cbirthday.set(Integer.parseInt(year), Integer.parseInt(month), > > > Integer.parseInt(day)); > > > birthday = cbirthday.getTime(); > > > > > > This last statement throws a cast exception! Even when I chnage it to: > > > birthday = (java.sql.Date) cbirthday.getTime(); > > > > > > Pls tell me what I'm doing wrongly. > > > > > > Emma > > > > > > > > > To change your membership options, refer to: > > > http://www.sys-con.com/java/list.cfm > > > > > > > > > To change your membership options, refer to: > > http://www.sys-con.com/java/list.cfm > > > > > > > > > > To change your membership options, refer to: > http://www.sys-con.com/java/list.cfm > > > To change your membership options, refer to: > http://www.sys-con.com/java/list.cfm > To change your membership options, refer to: http://www.sys-con.com/java/list.cfm To change your membership options, refer to: http://www.sys-con.com/java/list.cfm
