missing return statement错误请教?
在我的jsp中有如下程序:
<%!
public String sqlQuery(String num) {
Connection conn = null;
String connStr;
String content;
try {
connStr="jdbc:microsoft:sqlserver://10.1.72.15:1433;DatabaseName=test";
DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
conn = DriverManager.getConnection(connStr,"sa", "");
PreparedStatement st = conn.prepareStatement("select * from NEIKON_NEWS where id=?");
st.setString(1, num);
ResultSet rs=st.executeQuery();
Array ry=rs.getArray(6);
List ls=(List)ry.getArray();
content=(String)ls.get(0);
conn.close();
return content;
}catch(SQLException ex) {
System.out.println("Error in Connecting to the Database "+'\n'+ex.toString());
}
}
%>
<%
String id=request.getParameter("id");
String context=sqlQuery(id);
FCKeditor oFCKeditor;
oFCKeditor = new FCKeditor(request,"content");
oFCKeditor.setBasePath("../../FCKeditor/");
oFCKeditor.setHeight("500");
//oFCKeditor.setWidth("500");
oFCKeditor.setValue("context");
out.print(oFCKeditor.create());
%>
应该导入的包已经导入了.但是运行时仍然出现 missing return statement错误.
是不是我的程序哪块有问题,希望再次得到高手们的指点.