Skip to content

Commit

Permalink
Add Pikachu
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine-vinot-sonarsource committed Oct 17, 2023
1 parent 898d9fd commit 82920d6
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/main/java/test/Pikachu.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package test;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Collection;

public class Pikachu extends Pokemon {

public Pikachu(String name, String type, int level) {
super(name, type, level);
}

public void attack() {
System.out.println("Pikachu attack!");
}

private static PreparedStatement createStatement(String projectUuid, Collection<String> dispatcherKeys, Connection connection) throws SQLException {
String sql =
"SELECT count(1) FROM properties pp " +
"where pp.user_uuid is not null and (pp.entity_uuid is null or pp.entity_uuid=?) ";
PreparedStatement res = connection.prepareStatement(sql);
res.setString(1, projectUuid);
int index = 2;
for (String dispatcherKey : dispatcherKeys) {
res.setString(index, "PREFIX" + dispatcherKey + ".%");
index++;
}
return res;
}

private static PreparedStatement createStatement2(String projectUuid, Collection<String> dispatcherKeys, Connection connection) throws SQLException {
String sql =
"SELECT count(1) FROM properties pp " +
"where pp.user_uuid is not null and (pp.entity_uuid is null or pp.entity_uuid=?) ";
PreparedStatement res = connection.prepareStatement(sql);
res.setString(1, projectUuid);
int index = 2;
for (String dispatcherKey : dispatcherKeys) {
res.setString(index, "PREFIX" + dispatcherKey + ".%");
index++;
}
return res;
}
}

0 comments on commit 82920d6

Please sign in to comment.