B
BlueWin
Unregistered / Unconfirmed
GUEST, unregistred user!
//我在Jsp中定义一个函数,部份代码如下
<%!
public String GetDiv(String DID,int Level,int MaxLevel)
{
com.impartsoft.sql.ChangeUnicode changebean = new com.impartsoft.sql.ChangeUnicode();
com.impartsoft.sql.ConnectionPool sqlbean = new com.impartsoft.sql.ConnectionPool();
String RetChar="",Sps="",D_ID="",D_Name="";
ResultSet rsDN = null;
int HaveChild=0;
for (int i=0;i<Level;i++)
{
Sps = Sps + "&nbsp;&nbsp;&nbsp;";
}
rsDN = sqlbean.executeQuery("select top 1 DeptName from Department where DeptID='"+DID+"'");//这行有问题????
if (rsDN.next())
{
D_Name=rsDN.getString(1);
}
...
//结果却出现下列错误提示,
[blue]
Note: sun.tools.javac.Main has been deprecated.
/Home/BaseSet/DeptIndex1.jsp:40: Exception java.sql.SQLException must be
caught, or it must be declared in the throws clause of this method.
rsDN = sqlbean.executeQuery("select top 1 DeptName from Department where DeptID='"+DID+"'");
^
1 error, 1 warning
[/blue]
谁能告诉我,它是怎么了???
<%!
public String GetDiv(String DID,int Level,int MaxLevel)
{
com.impartsoft.sql.ChangeUnicode changebean = new com.impartsoft.sql.ChangeUnicode();
com.impartsoft.sql.ConnectionPool sqlbean = new com.impartsoft.sql.ConnectionPool();
String RetChar="",Sps="",D_ID="",D_Name="";
ResultSet rsDN = null;
int HaveChild=0;
for (int i=0;i<Level;i++)
{
Sps = Sps + "&nbsp;&nbsp;&nbsp;";
}
rsDN = sqlbean.executeQuery("select top 1 DeptName from Department where DeptID='"+DID+"'");//这行有问题????
if (rsDN.next())
{
D_Name=rsDN.getString(1);
}
...
//结果却出现下列错误提示,
[blue]
Note: sun.tools.javac.Main has been deprecated.
/Home/BaseSet/DeptIndex1.jsp:40: Exception java.sql.SQLException must be
caught, or it must be declared in the throws clause of this method.
rsDN = sqlbean.executeQuery("select top 1 DeptName from Department where DeptID='"+DID+"'");
^
1 error, 1 warning
[/blue]
谁能告诉我,它是怎么了???