当前位置: 技术问答>java相关
简单问题,160分相赠!!!
来源: 互联网 发布时间:2015-02-27
本文导语: http://www.csdn.net/expert/topic/323/323173.shtm servlet代码: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class insert_dosscard extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws...
http://www.csdn.net/expert/topic/323/323173.shtm
servlet代码:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class insert_dosscard extends HttpServlet
{
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
try{
String loginno = request.getParameter("login_no");
String password = request.getParameter("pass_word");
String rightpassword=null;
String sqlstr="insert into test values('abc')";
connectdb.db_base tb;/*此处报找不到类*/
tb = new connectdb.db_base();
....
beans代码:
package connectdb;
import java.sql.*;
public class db_base {
String sDBDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
String sConnStr = "jdbc:odbc:epmis";
Connection conn = null;
ResultSet rs = null;
public db_base() {
try {
........
环境win2000+jswdk+jdk1.3
benas所在目录webpagesWEB-INFjspbeansconnectdb
servlets所在目录webpagesWEB-INFservlets
将connectdb目录拷到servlets目录或classpath下的目录都不能解决找不到类的问题。
servlet代码:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class insert_dosscard extends HttpServlet
{
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
try{
String loginno = request.getParameter("login_no");
String password = request.getParameter("pass_word");
String rightpassword=null;
String sqlstr="insert into test values('abc')";
connectdb.db_base tb;/*此处报找不到类*/
tb = new connectdb.db_base();
....
beans代码:
package connectdb;
import java.sql.*;
public class db_base {
String sDBDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
String sConnStr = "jdbc:odbc:epmis";
Connection conn = null;
ResultSet rs = null;
public db_base() {
try {
........
环境win2000+jswdk+jdk1.3
benas所在目录webpagesWEB-INFjspbeansconnectdb
servlets所在目录webpagesWEB-INFservlets
将connectdb目录拷到servlets目录或classpath下的目录都不能解决找不到类的问题。
|
每增加一个package就得加到classpath中,如果package很多,可以一起打包成jar形式.
估计你今天肯定是什么细节弄错了,今天就放下吧,放松一下,明天就会好了.
估计你今天肯定是什么细节弄错了,今天就放下吧,放松一下,明天就会好了.