把jdbc的.jar文件放到[jre]\lib\ext目录下
[jre]为java的客户虚拟机安装的目录

解决方案 »

  1.   

    楼上的,你的方法不对啊!我的JRE如下我把JDBC的驱动都放进去了,还是不行啊。
    C:\Program Files\Java\j2re1.4.2_01\lib\ext出错信息如下
    java.sql.SQLException.[Microsoft][SQLServer 2000 Driver for JDBC]Error opening/loading com.microsoft.util.transliteration.properties.
      

  2.   

    晕,不是不对,错误提示不是变了吗???原来找不到类,现在找到了呀
    现在的错误应该是JDBC内部的,先确认你的JDBC是否完整!然后确定是否单机版(2m),如果是的话就换成完整版(6m)
      

  3.   

    这个我觉得差别不是很大。可能还是jdbc 的配置问题??
    我上次配jsp也是配置了好久,但是还是搞定!applet怎么连接就不太清楚啦。好象applet连接数据库很少见!
      

  4.   

    我安装了新的驱动还是不行啊,三个压缩文件(JDBC驱动)共412K。
    是不是这个啊???
    beyond_xiruo(CorruptionException)
      

  5.   

    是一个安装文件setup.exe,5-6m之间
      

  6.   


    //我把昨天的代码更改了一下。异常可以解决了。
      但是在保存时如果是汉字将会出现乱码。如何解决?请大家指教
    import java.util.zip.*;
    import java.awt.event.*;  
    import java.awt.*;  
    import java.lang.Math;  
    import java.io.*;  /**
    *利用Java实现zip压缩/解压缩
    */ public class TestZip extends Frame implements ActionListener {
      TextArea textarea; //显示数据文件的多行文本显示域  
      TextField infotip; //显示数据文件未压缩大小及压缩大小单行文本显示域  
      String doc; //存储随机生成的数据  
      long doczipsize = 0;//压缩数据文件的大小  
        public TestZip(){  
            //生成菜单      MenuBar menubar = new MenuBar();  
        setMenuBar(menubar);  
        Menu file = new Menu("File",true);  
        menubar.add(file);  
        MenuItem neww= new MenuItem("New");  
        neww.addActionListener(this);  
        file.add(neww);  
        MenuItem open=new MenuItem("Open"); 
        open.addActionListener(this);  
        file.add(open);  
        MenuItem save=new MenuItem("Save"); 
        save.addActionListener(this);  
        file.add(save);
        MenuItem exit=new MenuItem("Exit");  
        exit.addActionListener(this);  
        file.add(exit);  
        //随机生成的数据文件的多行文本显示域  
        add("Center",textarea = new TextArea());  
        //提示文本原始大小、压缩大小的单行文本显示域  
        add("South",infotip = new TextField()); 
        
        WindowListener listener = new WindowAdapter()
         {
           public void windowClosing(WindowEvent e)
           {
             System.exit(0);
           }
         };
         this.addWindowListener(listener);    }  public static void main(String args[]){
    TestZip ok=new TestZip(); 
    ok.setTitle("zip sample");  
    ok.setSize(600,300);  
    ok.show();  
    }  

    private void randomData(){  
    //随机生50个double数据,并放在doc字符串变量中。
    doc="";  
    for(int i=1;i<51;i++){  
    double rdm=Math.random()*20;  
    doc=doc+new Double(rdm).toString();  
    if(i%5 == 0) doc=doc+"\n";  
    else doc=doc+" ";  
    }  
    doczipsize = 0;  
    showTextandInfo();  
    }  


    private void openFile(){  
    //打开zip文件,将文件内容读入doc字符串变量中。  
    FileDialog dlg=new FileDialog(this,"打开",FileDialog.LOAD);  
    dlg.show();  
    String filename=dlg.getDirectory()+dlg.getFile(); 
    /**try{
    File f=new File(filename);  
            FileInputStream fin=new FileInputStream(f); 
            byte[] buf=new byte[1024]; 
            int number;
    while ((number=fin.read(buf,0,buf.length)) != -1) 
       textarea.append(buf+"\n"); 
    }

    catch(Exception e)
      {
       e.printStackTrace();
      }
        
         */
         
    //textarea.append("\n"+filename);
    try{  
    //创建一个文件实例  
    File f=new File(filename);  
    if(!f.exists()) return;  //文件不存在,则返回  
    //用文件输入流构建ZIP压缩输入流  
    ZipInputStream zipis=new ZipInputStream(new FileInputStream(f));  
    zipis.getNextEntry();  
    //将输入流定位在当前entry数据项位置  
    DataInputStream dis=new DataInputStream(zipis);  
    //用ZIP输入流构建DataInputStream
    //doc=dis.readUTF();//读取文件内容  
        /**
        doc=dis.readLine();
        dis.close();//关闭文件  
    doczipsize = f.length();//获取ZIP文件长度  
    showTextandInfo();//显示数据 
    */
    String readline=new String("");
    doczipsize = f.length();//获取ZIP文件长度  
        doc=dis.readLine();
    while((readline=dis.readLine()).length()!=0)
    {
    doc=doc+"\n"+readline;

    }
    showTextandInfo();//显示数据 
    dis.close();//关闭文件  
     
    }  

    catch(IOException ioe)
    {
    System.out.println(ioe);  
    }

           
     }  

    private void saveFile(){  
    //打开zip文件,将doc字符串变量写入zip文件中。  

    FileDialog dlg=new FileDialog(this,"保存",FileDialog.SAVE);  
    dlg.show();  
    String filename=dlg.getDirectory()+dlg.getFile();  
    try{  
    //创建一个文件实例  
    File f=new File(filename);  
    if(!f.exists()) return; //文件不存在,则返回  
    //用文件输出流构建ZIP压缩输出流  
    ZipOutputStream zipos=new ZipOutputStream(new FileOutputStream(f));  
    zipos.setMethod(ZipOutputStream.DEFLATED); //设置压缩方法  
    zipos.putNextEntry(new ZipEntry("zip"));  
    //生成一个ZIP entry,写入文件输出流中,并将输出流定位于entry起始处。  
    DataOutputStream os=new DataOutputStream(zipos);  
    //用ZIP输出流构建DataOutputStream;  
    //os.writeUTF(doc);//将随机生成的数据写入文件?
    //doc=new String("数据测试!!!");
    os.writeBytes(doc);
    os.close();//关闭数据流  
    doczipsize = f.length();  
    //获取压缩文件的长度
    showTextandInfo();//显示数据  
    }  
    catch(IOException ioe){  
    System.out.println(ioe);  
    }  
      }  
      
      private void showTextandInfo(){  
      //显示数据文件和压缩信息  
      textarea.replaceRange(doc,0,textarea.getText().length());  
      //textarea.append(doc);
      infotip.setText("uncompressed size: "+doc.length()+"compressed size: "+doczipsize);  
      }  
      
      public void actionPerformed(ActionEvent e)
      {
       String arg = e.getActionCommand();  
       if ("New".equals(arg)) randomData();  
       else if ("Open".equals(arg)) openFile();  
       else if ("Save".equals(arg)) saveFile();  
       else if ("Exit".equals(arg)){  
       dispose();//关闭窗口  
       System.exit(0);//关闭程序  
      
       }  
      
       else {
       System.out.println("no this command!");
       }  
      
        
      
      
      
       }  
      }