Casting really just tells the compiler that you know what you are doing and it should just let you do it. If, however, the object that you are assigning to a Connection is not really a Connection, then you will get a ClassCastException. I think you have just pushed your error to runtime instead of compile time. Joe Teff -----Original Message----- From: email@example.com [mailto:firstname.lastname@example.org]On Behalf Of Maarten Vries, de Sent: Tuesday, January 30, 2001 4:54 PM To: JAVA400-L@midrange.com Subject: Re: JDBC Problems Indeed, the error I am getting is at compile time. Your statement seems to work fine altough I have to make same changes to the rest of the program. It is strange, because I followed the book. Even when Dave is able to compile it. Message for Dave, the longshots did not work either. Can you tell me why I have to put (Connection) in front of the java.sql.DriverManager.getConnection? Maarten (I am still a newbie and Dutch to, so sorry if the language is not totally ok) +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: email@example.com +---
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.