Created
May 18, 2012 17:14
-
-
Save krisskross/2726488 to your computer and use it in GitHub Desktop.
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.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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment