import java.sql.*; public class dataExtract { public static void main (String args []) { try{ Statement sqlStmt; String userid; String password; ResultSet resultSet; userid = "userid";//hard code or get it from arguments password = "password";//hard code or get it from arguments Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); dbConn = DriverManager.getConnection("jdbc:odbc:ODBCdsnName);//substitute ODBCdsnName //with anem of your dsn sqlCmd = "SELECT * FROM whatever table"; sqlStmt = dbConn.createStatement(); resultSet = sqlStmt.executeQuery(sqlCmd); Santosh "Zhang, David" <[EMAIL PROTECTED]> on 01/24/2001 03:59:16 PM Please respond to A mailing list about Java Server Pages specification and reference <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] cc: (bcc: Santosh Daryani/IT/Aon Consulting) Subject: Asking sample on JSP to access the SqlServer Database Hi all, I am new at JSP. I want use JSP to access the SqlServer Database (I have set the ODBC) please point me to some JSP samples on this . Thanks Dave =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". 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". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". 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