where is the method signature. You have directly coded evrything in the
class body. Put your code within method body and then compile...it won't
give such error....

> ----------
> From:         Marcel van Kooy[SMTP:[EMAIL PROTECTED]]
> Reply To:     A mailing list about Java Server Pages specification and
> reference
> Sent:         Monday, July 31, 2000 3:32 PM
> To:   [EMAIL PROTECTED]
> Subject:      Connection to a database - failure
>
> Hi all,
>
> Can somebody please help me with this problem.
> When I compile this source-code, for making a connection to a database,
> I'll receive the error "type expected" in the first TRY-statement.
> How can I solve this and what does it mean?
> Thanks,
> Marcel van Kooy
>
> import java.sql.*;
>
> public class TestBean {
>
>     try {
>         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>     }
>
>     catch( Exception e ) {
>         System.out.println("Failed to load JdbcOdbcDriver.");
>         return;
>     }
>
>     try {
>         Connection con =
> DriverManager.getConnection("jdbc:odbc:Studio_Bezoekers", "", "");
>         Statement select = con.createStatement();
>         ResultSet result = select.executeQuery
>                             ("...A query...");
>
> ==========================================================================
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to