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

defining functions clojure

How to retain the space of the td after hidding it in Jquery

Integrating Struts2 with Spring Security using Custom Login Form