dcsimg
why am i getting the error 'java.sql.SQLException :No suitable driver' when iam trying to connect to the sql server database?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   phani_kumar
Posted On:   Saturday, June 26, 2004 03:18 AM

I have written a struts example that collects some user data from the html file and saves the data into database. The following lines have been added to the struts-config.xml file. The following lines have been added to the userRegistrationAction.java file. Connection conn =null; DataSource dataSource = null; dataSource = getDataSource(req, "userDB"); conn = dataSource.getConnection(); PreparedStatement statement = conn.prepareStatement("insert into USERdata " +"(EMAIL, FIRST_NAME, LAST_NAME, PWORD, PHONE, FAX)" + " values (?,?,?,?,?,?)");    More>>

I have written a struts example that collects some user data from the html file and saves the data into database. The following lines have been added to the struts-config.xml file.






















The following lines have been added to the userRegistrationAction.java file.
Connection conn =null;

DataSource dataSource = null;

dataSource = getDataSource(req, "userDB");

conn = dataSource.getConnection();

PreparedStatement statement = conn.prepareStatement("insert into USERdata " +"(EMAIL, FIRST_NAME, LAST_NAME, PWORD, PHONE, FAX)" + " values (?,?,?,?,?,?)");

statement.setString(1,userForm.getEmail());

statement.setString(2,userForm.getFirstName());

statement.setString(3,userForm.getLastName());

statement.setString(4,userForm.getPassword());

statement.setString(5,userForm.getPhone());

statement.setString(6,userForm.getFax());

statement.executeUpdate();


when iam running the file 'userRegistration.jsp', iam getting the error, 'java.sql.SQLException:No Suitable Driver'.

Someone please help me urgently in this matter.

thanks in advance,
phani kumar

   <<Less
About | Sitemap | Contact