Topic: 各位大哥帮看一下 (cannot resolve symbol)

  Print this page

1.各位大哥帮看一下 (cannot resolve symbol) Copy to clipboard
Posted by: amw0007
Posted on: 2004-02-02 13:08

import java.sql.*;
import javax.sql.*;
import com.microsoft.jdbc.sqlserver.*;

public class createtable
{
  Connetion conn=null;
  ResuldSet rs=null;
  StateMent stmt=null;
  String driverName="com.microsoft.jdbc.sqlserver.SQLServerDriver";
  String connURL="jdbc:microsoft:sqlserver://jav:1433;User=sa;password=00781127;DatabaseName=sales";
  String name,age,address,email,str;
  public void LoadDriver()
  {
    try
    {
      Class.forName(driverName);
    }
    catch(ClassNotFoundException e)
    {
      System.err.printn("LoadDriver():Failed"+e.getMessage());
    }
  }
  public void Modify()
  {
    try
    {
      conn=DriverManager.getConnetion(connUrl);
      stmt=conn.createStateMent();
      str="CREATE TABLE customer(cName VARCHAR(10),cAge SMALLINT,cAddress VARCHAR(20))";
      stmt.executeUpdate(str);
      str="ALTER TABLE customer ADD cMail VARCHAR(20)";
      stmt.executeUpdate(str);
      str="INSERT INTO customer(cName,cAge,cAddress,cMail) value ('Mike',45,'nNewYork',mioen@315.net')";
      stmt.executeUpdate(str);
      str="INSERT INTO customer(cName,cAge,cAddress,cMail) value ('success',27,'yuann','fly@21cn.com')";
      stmt.executeUpdate(str);
      str="INSERT INTO customer(cName,cAge,cAddress,cMail) value ('huang',30,'guangxi','name@263.net')";
      stmt.executeUpdate(str);
      rs=stmt.executeQuery("select * from customer");
      while(rs.next())
      {
        name=rs.getString("cName");
        age=rs.getString("cAge");
        address=rs.getString("cAddress");
        email=rs.getString("cMail");
        System.out.println(name+" "+age+" "+address+" "+email);
      }
      conn.close();
      stmt.close();
      rs.close();
    }
    catch(SQLException sqle)
    {
      System.err.println(sqle.getMessage());
    }
  }
  public static void main(String args[])
  {
    createtable create=new createtable();
    create.LoadDriver();
    create.Modify();
  }

编译后出错
D:\JCreator Pro\MyProjects\apple\createtable.java:7: cannot resolve symbol
symbol : class Connetion
location: class createtable
  Connetion conn=null;
^
Connection

D:\JCreator Pro\MyProjects\apple\createtable.java:8: cannot resolve symbol
symbol : class ResuldSet
location: class createtable
  ResuldSet rs=null;
^
ResultSet

D:\JCreator Pro\MyProjects\apple\createtable.java:9: cannot resolve symbol
symbol : class StateMent
location: class createtable
  StateMent stmt=null;
^
Statement

D:\JCreator Pro\MyProjects\apple\createtable.java:21: cannot resolve symbol
symbol : method printn (java.lang.String)
location: class java.io.PrintStream
      System.err.printn("LoadDriver():Failed"+e.getMessage());
^
println

D:\JCreator Pro\MyProjects\apple\createtable.java:28: cannot resolve symbol
symbol : variable connUrl
location: class createtable
      conn=DriverManager.getConnetion(connUrl);
^
connURL

5 errors

2.Re:各位大哥帮看一下 [Re: amw0007] Copy to clipboard
Posted by: helloworld
Posted on: 2004-02-02 13:24

没找到JDBC驱动

3.Re:各位大哥帮看一下 [Re: amw0007] Copy to clipboard
Posted by: leowu2000
Posted on: 2004-02-02 13:57

呵呵!你要么是键盘没有摸熟,要么就是打字飞快的那种人!:) 不过呢,错了很多单词。。。再检查检查自己敲的字符吧。

或者说你的键盘上的键很多都坏了也不一定 Tounge

4.Re:各位大哥帮看一下 [Re: amw0007] Copy to clipboard
Posted by: yeehya
Posted on: 2004-03-22 15:26

郁闷的人呀!

5.Re:各位大哥帮看一下 (cannot resolve symbol) [Re: amw0007] Copy to clipboard
Posted by: cityoflight
Posted on: 2004-04-29 17:19

老兄是不是盲打啊Big Smile


helloworld wrote:
没找到JDBC驱动

Big Smile


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923