日期:2014-05-17  浏览次数:20754 次

prepareStatement ()
package conn.db;
import java.sql.*;
/**
....
....
Connection conn=null;
...
...
public void executeInsert(String sql)
  {
  try
  {
  conn=DriverManager.getConnection(sConnStr);
  PreparedStatement stmt=conn.prepareStatement();
  ......
代码如上 运行结果下:
cannot resolve symbol
symbol : method prepareStatement ()
location: interface java.sql.Connection
  PreparedStatement stmt=conn.prepareStatement();
  ^
1 error
  各位大佬 这个方法还有救吗? 小弟用的是SQL server

------解决方案--------------------
PreparedStatement stmt=conn.prepareStatement(sql);