hello give the try block with in the function or make it as static...
it will work..
try and let me know...
regards
suriya
*Q try for everything Q*
Suriya narayanan V
Software Engineer
Contech Software Ltd
E-3/1,2,3, GIDC Electronics Estate,
Sector - 25, Gandhinagar - 382 044, INDIA
Tel. : +91(2712) 44989/43324/43328
(R) : 91 - 79 - 6746164
fax :+91 (2712) 24468
Email :[EMAIL PROTECTED],[EMAIL PROTECTED]
URL : http://www.contechgroup.com
HomePage : http://www.suriyan.org
-----Original Message-----
From: Marcel van Kooy [SMTP:[EMAIL PROTECTED]]
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