⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme_setup.html

📁 applet to servlet use to change from applet to servlet
💻 HTML
字号:
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en] (Win95; U) [Netscape]">
   <META NAME="Author" CONTENT="Chad Darby">
   <TITLE>Applet and Servlet Communication</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000">
&nbsp;
<TABLE WIDTH="100%" >
<TR>
<TD WIDTH="20%"></TD>

<TD WIDTH="60%">
<CENTER>
<H1>
Applet and Servlet Communication</H1></CENTER>

<CENTER>
<H3>
<FONT COLOR="#000000"><FONT SIZE=+1>By Ch&aacute;d Darby</FONT></FONT>&nbsp;</H3></CENTER>

<CENTER>
<H3>
<FONT SIZE=+0>Java Developer's Journal, September 1998</FONT></H3></CENTER>
</TD>

<TD WIDTH="20%"></TD>
</TR>
</TABLE>

<HR>
<H2>
Installation Guide</H2>

<H3>
1.&nbsp; Setting up Database Connection</H3>
The application requires a database connection.

<P>You can connect to any database that has a JDBC-compliant driver.&nbsp;
By default, this application uses the JDBC-ODBC bridge-driver that is provided
with the JDK 1.1.&nbsp; A sample MS Access database is provided (<B>students.mdb</B>).

<P>1.1&nbsp; You can use the sample database provided or create your own.&nbsp;
If you create your own, then you should use the following database schema.&nbsp;
You should also populate your database with sample data.
<UL>
<LI>
ID: autonumber</LI>

<LI>
LastName: text</LI>

<LI>
FirstName: text</LI>

<LI>
Email: text</LI>

<LI>
Company: text</LI>

<LI>
CourseTitle: text</LI>

<LI>
CourseLocation: text</LI>

<LI>
CourseStartDate: date/time</LI>
</UL>
1.2&nbsp; Setup a data source connection (DSN) to your database.
<UL>
<LI>
If you are using a Windows 95/NT platform then select START | SETTINGS
| CONTROL PANEL.&nbsp; Run the 32-bit ODBC program.</LI>

<UL>
<LI>
ADD a new datasource.</LI>

<LI>
Choose the driver type for your database (ie MS Access, SQL Server)</LI>

<LI>
For Data Source Name enter: <B>StudentDatabase</B></LI>

<LI>
Select your database (students.mdb) by navigating the file system or giving
the database server information.</LI>
</UL>
For other platforms, please consult your JDBC driver documentation.</UL>
1.3&nbsp; <B>Database Parameters.</B>&nbsp; You can provide different database
parameters to the servlet.&nbsp; These parameters are set during the administration
of the servlet.
<UL>
<LI>
dbDriver - name of the database driver class name (default = sun.jdbc.odbc.JdbcOdbcDriver)</LI>

<LI>
dbURL - complete database URL (default = jdbc:odbc:StudentDatabase)</LI>

<LI>
userid - user id (default = &lt;none>)</LI>

<LI>
passwd - password (default = &lt;none>)</LI>
</UL>

<H3>
2.&nbsp; Install the Servlet</H3>
2.1&nbsp; Copy the file <B>studentdb_server.jar</B> to your web servers
"servlet" directory.
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;WEB_SERVER_HOME>/servlets

<P>2.2&nbsp; Add the <B>studentdb_server.jar</B> file to your CLASSPATH.
(very important)

<P>2.3&nbsp; Start your web server and add your servlet using your web
server's admin tool.&nbsp; Set the following properties:
<UL>
<LI>
servlet name = StudentDBServlet</LI>

<LI>
servlet class&nbsp; = StudentDBServlet</LI>

<LI>
You can configure optional parameters as listed above in step 1.3</LI>
</UL>

<H3>
3.&nbsp; Install the Applet</H3>
3.1&nbsp; Create a directory in your web server's "public_html" directory,
I'll call it <B>students</B>.

<P>3.2&nbsp; Copy the file <B>studentdb_client.jar</B> to the <B>students</B>
directory created in step 3.1

<P>3.2&nbsp; Copy the files <B>index.html</B> and <B>index_no_plugin.html</B>
to the <B>students</B> directory created in step 3.1

<P>3.4&nbsp; You should have the following files in the <B>students</B>
sub-directory:
<UL>
<LI>
studentdb_client.jar</LI>

<LI>
index.html</LI>

<LI>
index_no_plugin.html</LI>
</UL>

<H3>
4.&nbsp; Test the Applet and Servlet</H3>
<I><B>NOTE:</B>&nbsp; You must use a browser that is fully JDK 1.1 compliant.&nbsp;
I'd recommend that you use Sun's Java Plug-In for best results.</I>

<P>4.1&nbsp; Make sure your web server is started w/ <B>studentdb_server.jar</B>
in the CLASSPATH.

<P>4.2&nbsp; Visit your web site&nbsp; <B>http://localhost:8080/students/index.html</B>

<P>4.3&nbsp; Press the button to display the students.&nbsp; Register a
new student.

<P>4.4&nbsp; Congrats!

<P>
<HR WIDTH="100%"><!--webbot bot="Include" u-include="../../basic_footer.htm" tag="BODY" startspan -->
<CENTER><FONT SIZE=-2><A HREF="http://www.j-nine.com/main.htm">HOME</A></FONT></CENTER>

<CENTER><FONT SIZE=-2><A HREF="http://www.j-nine.com/services/training.htm">TRAINING</A>
| <A HREF="http://www.j-nine.com/services/consulting.htm">CONSULTING</A>
| <A HREF="http://www.j-nine.com/services/development.htm">DEVELOPMENT</A>
| <A HREF="http://www.j-nine.com/pubs/index.htm">PUBLICATIONS</A> | <A HREF="http://www.j-nine.com/aboutj9.htm">ABOUT</A></FONT></CENTER>

<CENTER><FONT SIZE=-2><A HREF="http://www.j-nine.com/aboutj9.htm#Contacts">REQUEST
INFO</A></FONT></CENTER>

<CENTER><I><FONT SIZE=-1>Copyright &copy; 1998, J9 Consulting</FONT></I></CENTER>

<CENTER><I>August 02, 1998</I></CENTER>
<!--webbot bot="Include" endspan i-checksum="58553" -->
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -