Guest User

Untitled

a guest
Oct 11th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. import javax.validation.constraints.Max;
  2. import javax.validation.constraints.Min;
  3. import javax.validation.constraints.Pattern;
  4. import javax.validation.constraints.Size;
  5.  
  6. @Configuration
  7. public class MysqlXADataSource {
  8. @Property(desc = "User name to use for connection authentication.")
  9. @Size(min = 6, max = 255)
  10. private String user = ""; // default value - hence optional property
  11.  
  12. @Property(desc = "Password to use for connection authentication.")
  13. @Size(min = 6, max = 255)
  14. private String password = ""; // default value - hence optional property
  15.  
  16. @Property(desc = "A JDBC URL.")
  17. @Pattern(regexp = "([a-zA-Z]{3,})://([\w-]+\.)+[\w-]+(/[\w- ./?*)?")
  18. private URL url; // required property
  19.  
  20. @Property(desc = "Port number where a server is listening for requests.")
  21. @Min(0)
  22. @Max(65535)
  23. private Integer portNumber = 1521; // default value - hence optional property
  24.  
  25. @Resource
  26. private List<ConfigurableItem> items; // configuration childs
  27. }
  28.  
  29. @Stateless
  30. public class SessionBean {
  31. @Resource(name = "jdbc/mysql-ds")
  32. private DataSource ds;
  33. }
Add Comment
Please, Sign In to add comment