Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.validation.constraints.Max;
- import javax.validation.constraints.Min;
- import javax.validation.constraints.Pattern;
- import javax.validation.constraints.Size;
- @Configuration
- public class MysqlXADataSource {
- @Property(desc = "User name to use for connection authentication.")
- @Size(min = 6, max = 255)
- private String user = ""; // default value - hence optional property
- @Property(desc = "Password to use for connection authentication.")
- @Size(min = 6, max = 255)
- private String password = ""; // default value - hence optional property
- @Property(desc = "A JDBC URL.")
- @Pattern(regexp = "([a-zA-Z]{3,})://([\w-]+\.)+[\w-]+(/[\w- ./?*)?")
- private URL url; // required property
- @Property(desc = "Port number where a server is listening for requests.")
- @Min(0)
- @Max(65535)
- private Integer portNumber = 1521; // default value - hence optional property
- @Resource
- private List<ConfigurableItem> items; // configuration childs
- }
- @Stateless
- public class SessionBean {
- @Resource(name = "jdbc/mysql-ds")
- private DataSource ds;
- }
Add Comment
Please, Sign In to add comment