コード例 #1
0
ファイル: WikiDB.java プロジェクト: CarstenG/printwikipedia
 /**
  * Select the topic data from the database
  *
  * @param name the name of the topic
  * @return <code>null</code> if no data was found
  * @throws Exception
  */
 public TopicData selectTopic(String name) throws Exception {
   TopicData topicData = new TopicData(name);
   fSelectContent.setString(1, name);
   ResultSet resultSet = fSelectContent.executeQuery();
   try {
     while (resultSet.next()) {
       topicData.setContent(resultSet.getString(1));
       return topicData;
     }
   } finally {
     resultSet.close();
   }
   return null;
 }
コード例 #2
0
ファイル: WikiDB.java プロジェクト: CarstenG/printwikipedia
 public void updateTopic(TopicData topic) throws Exception {
   fUpdateTopicContent.setString(1, topic.getContent());
   fUpdateTopicContent.setString(2, topic.getName());
   fUpdateTopicContent.execute();
 }
コード例 #3
0
ファイル: WikiDB.java プロジェクト: CarstenG/printwikipedia
 public void insertTopic(TopicData topic) throws Exception {
   fInsertTopic.setString(1, topic.getName());
   fInsertTopic.setString(2, topic.getContent());
   fInsertTopic.execute();
 }