This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* splits the string at every nth position | |
* @param str | |
* @param position | |
* @return a list of Strings each string has a length <= position | |
*/ | |
public static List<String> splitEveryPosition(String str, Integer position) { | |
List<String> strings = new ArrayList<String>(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
o1.name AS FK_table, | |
c1.name AS FK_column, | |
fk.name AS FK_name, | |
o2.name AS PK_table, | |
c2.name AS PK_column, | |
pk.name AS PK_name, | |
fk.delete_referential_action_desc AS Delete_Action, | |
fk.update_referential_action_desc AS Update_Action | |
FROM sys.objects o1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity | |
public class User { | |
@Id | |
private String userId; | |
private String lastName; | |
private String ssn; | |
// other fields and getter and setters | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * | |
from User | |
where | |
userId in (:userIds) | |
-- Then we need an OR clause for each match we want | |
OR ( lastName = :lastName1 AND SUBSTRING(ssn, LEN(ssn)-3, 4) = :lastFourSsn1) | |
OR ( lastName = :lastName2 AND SUBSTRING(ssn, LEN(ssn)-3, 4) = :lastFourSsn2) | |
-- ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Class used to filter the User entity | |
*/ | |
public class UserParameter { | |
private String userId; | |
private String lastName; | |
/* only last 4 digits */ | |
private String ssn; | |
// getters and setters | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.bmchild.data.shared.batch; | |
import javax.sql.DataSource; | |
import org.apache.commons.lang.Validate; | |
import org.springframework.jdbc.core.BatchPreparedStatementSetter; | |
import org.springframework.jdbc.core.JdbcTemplate; | |
/** | |
* @author bchild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-Dcom.sun.management.jmxremote | |
-Dcom.sun.management.jmxremote.port=1234 | |
-Dcom.sun.management.jmxremote.authenticate=false | |
-Dcom.sun.management.jmxremote.ssl=false | |
-Djava.rmi.server.hostname=127.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Employable { | |
String MY_CONSTANT = "value" | |
} | |
public class MyClass { | |
private String theConstant = Employable.MY_CONSTANT; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mypackage; | |
import java.lang.reflect.Method; | |
import java.util.Enumeration; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpSession; | |
public class ToStringUtil { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> | |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> | |
<appender name="stdout" class="org.apache.log4j.ConsoleAppender"> | |
<layout class="org.apache.log4j.PatternLayout"> | |
<!-- Pattern to output the caller's file name and line number --> | |
<param name="ConversionPattern" value="%d{ISO8601} [%p] %m [(%M)%c]%n" /> | |
</layout> |