java函数调用问题...

来源:百度知道 编辑:UC知道 时间:2024/05/04 02:12:06
查询最大id所对应的内容

public String getInfo(String max)
{
Date date = new Date();
System.out.println(date.toString());
boolean flag;
String str = null;
try {
flag = this.ConnData();
if(flag == true)
{
System.out.println("chenggong");
}
else
{
System.out.println("shibai");
}
} catch (Exception ex) {
System.err.println(ex.getMessage());
}
String m_bean;
try{
System.out.println(this.getMaxId());
m_bean = this.searchByID(this.getMaxId());
str = m_bean;
System.out.println(str);
} catch (Exception ex) {
System.err.println(ex.getMessage());
}

this.close();
return str;
}

调用上面函数 把最大id内容写入指定表的字段中

import java.sql.*;
public class tcdata {
pu

m_bean = this.searchByID(this.getMaxId());
str = m_bean

多次一举!
String strSql = "insert into Tc_Content(TServiceCode,TCode,TConent,TStatus,TDate) " +
"values('0099','','" + t1 + "','','')";
写的不对,检查下!

String strres;
TC12580 t1 = new TC12580();
strres=t1.getInfo(str);
String strSql = "insert into Tc_Content(TServiceCode,TCode,TConent,TStatus,TDate) " +
"values('0099','','" + strres + "','','')";
改下sql语句,再试下!