(Eclipse Edition) Struts Environment Configuration Manual

Source: Internet
Author: User
Tags microsoft sql server sql server driver stmt tld stringbuffer

Struts Environment Configuration manual

Download URL: http://www.eclipse.org/

Download URL: http://jakarta.apache.org/site/binindex.cgi

Download URL: http://jakarta.apache.org/site/binindex.cgi

4.tomcat for Eclipse Plug-in
Download URL: http://www.sysdeo.com/eclipse/tomcatPlugin.html

5.easy Struts Plugin
Download URL: http://sourceforge.net/projects/easystruts

6.EJB development tool Lomboz (not required)
Download URL: http://www.objectlearn.com/

Copy each of the above 4 com.sysdeo.eclipse.tomcat_2.2.1 and the com.cross.easystruts.eclipse_0.6.4 in the above 5 to
eclipse/plugins/, and then make the following settings

1.Tomcat initialization settings: Start Eclipse, open the Settings window via menu windows->preferences
Select Tomcat and do the configuration
1.Easy initialization settings for struts: Start Eclipse, open the Settings window via menu windows->preferences
Select Struts 1.1 and locate and add the Struts.jar file in the library files required for Struts 1.1
3. In the type library description required for Struts 1.1, it is recommended that at least the three described documents mentioned above be added to:
Struts_html.tld, Struts_bean.tld, Struts_logic.tld, these three files are automatically copied to the project's Web-inf directory when the Struts application project is created.
4. Create a new Tomcat project, then right-click Project->properties->libraries and add all of the packages in Struts 1.1
5. New Add Easy Struts Support
6. Copy all of the packages from Struts 1.1 to project->web-inf/lib/

Get data with Java Connection SQL Server 2000
1. Download the JDBC for SQL Server driver:
Click setup.exe Download Driver
2. Install after downloading, install with default setting, will be installed to:
C:/Program Files/microsoft SQL Server Driver for JDBC
3. C:/Program Files/microsoft SQL Server Driver for Jdbc/lib
The following Mssqlserver.jar,msbase.jar,msutil.jar three files are copied to your
JDK Home directory/jre/lib/ext below, JDBC driver is now configured
4. Compile and run the test program:
String drivername = "Com.microsoft.jdbc.sqlserver.SQLServerDriver";
String Connurl = "jdbc:microsoft:sqlserver://bluesky:1433;"
User=sa; Password=sa;databasename=sitedb ";
Class.forName (drivername);
Connection conn = drivermanager.getconnection (Connurl);
Statement stmt = Conn.createstatement ();
StringBuffer strSQL = new StringBuffer ();
Strsql.append ("select * from usertable where username = '" + username + "");
ResultSet rs = stmt.executequery (strsql.tostring ());
if (!rs.next () | |! Password.equals (Nulltostring (rs.getstring ("password")). Trim ()) {
Dbmsg = "Sorry, the user you entered does not exist or the user password is incorrect";
Username = nulltostring (rs.getstring ("username"));
Selectright = nulltostring (rs.getstring ("Selectright"));
Deleteright = nulltostring (rs.getstring ("Deleteright"));
Updateright = nulltostring (rs.getstring ("Updateright"));

}catch (ClassNotFoundException ex) {
Ex.printstacktrace ();
}catch (SQLException ex) {
Ex.printstacktrace ();

Struts!! go!!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.