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
import org.jooq.DSLContext; | |
import org.jooq.Record; | |
import org.jooq.Result; | |
import org.jooq.SQLDialect; | |
import org.jooq.impl.DSL; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import static example.jooq.Tables.AUTHOR; |
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
create table PERSON ( | |
ID int not null, | |
NAME varchar(100) not null | |
); |
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
{ | |
"title": "Example Schema", | |
"type": "object", | |
"properties": { | |
"firstName": { | |
"type": "string" | |
}, | |
"lastName": { | |
"type": "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
package example.misc; | |
import javax.script.ScriptEngine; | |
import javax.script.ScriptEngineManager; | |
import java.io.FilePermission; | |
import java.security.AccessControlContext; | |
import java.security.AccessControlException; | |
import java.security.AccessController; | |
import java.security.AllPermission; | |
import java.security.CodeSource; |
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 example.jaxrs; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.core.Context; | |
import javax.ws.rs.core.HttpHeaders; | |
import javax.ws.rs.core.UriInfo; | |
@Path("/") | |
public class ContextResource { |
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 example.misc; | |
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
public class HmacDemo { | |
private static final String SECRET = "secret key"; | |
private static final String TEXT = "This is a pen."; |
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 example.jaxrs; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.MediaType; | |
import java.util.Arrays; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; |
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 example.misc; | |
import org.json.JSONObject; | |
public class JsonCompare { | |
public static void main(String[] args) { | |
final JSONObject o1 = new JSONObject("{\'a\': 'hoge', b: 'bar', c: [1,3,5], bb: {e: 'あ'}}"); | |
final JSONObject o2 = new JSONObject("{b: 'bar', \nc:[1,\n3,5], a: \n'hoge', \"bb\": {e: '\\u3042'}}"); | |
System.out.println(o1.toString()); |
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
import javax.validation.constraints.DecimalMax; | |
import javax.validation.constraints.DecimalMin; | |
import javax.validation.constraints.NotNull; | |
import javax.validation.constraints.Pattern; | |
// ... | |
// ...... | |
// ... |
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 example.jaxrs; | |
import javax.validation.constraints.NotNull; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.QueryParam; | |
@Path("/") | |
public class HelloValidateResource { | |
@GET |