Connect to MySQL DataBase using DataSource without connection pool

Connect to Mysql-database using datasource

import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;


public class UserDAOTest {

MysqlDataSource ds;
public UserDAOTest() {
ds=new MysqlDataSource();
ds.setDatabaseName("csajsp");
ds.setURL("jdbc:mysql://localhost:3306/csajsp");
ds.setPassword("prdc123");
ds.setUser("root");
ds.getConnection();
}


Comments

Popular posts from this blog

Spring MVC- Redirect from one controller to another

Jquery Table Inline Edititing