📄 topicdao3.java
字号:
package dao;
import javax.sql.RowSet;
public class TopicDao3 {
public RowSet getTitlesByAuthorName(String authorName) {
SqlBean sb=SqlBean.getInstance();
return sb.getRowSet("select a.name title,b.name author from topic a,author b where a.user_id=b.id and b.name='"+authorName+"'","");
}
public static void main(String[] args) {
TopicDao3 app = new TopicDao3();
try
{
RowSet rs = app.getTitlesByAuthorName("bbb");
while(rs.next())
{
System.out.print("titile="+rs.getString("title")+",author=");
System.out.println(rs.getString("author"));
}
}
catch (Exception e) {
// TODO 自动生成 catch 块
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -