wood burning stoves 2.0*
The moose likes JDBC and the fly likes problem connecting to sql database using jtds driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "problem connecting to sql database using jtds driver" Watch "problem connecting to sql database using jtds driver" New topic
Author

problem connecting to sql database using jtds driver

Rituparna Duttagupta
Ranch Hand

Joined: Feb 08, 2011
Posts: 55

hi friends, this is me again.
i was developing a e-tutorial site, and tried to handle the database through the jtds driver for sql.
i've created a regn page, which passes on the values of the form to a servlet which calls a sessionbean, which handles the database.
to connect to database(YGExam) of the sql server(ERT-PC) having username(sa) and password(123), i've written the following code-
Class.forName("net.sourceforge.jtds.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:jtds:sqlserver://ERT-PC:1433/YGExam; instance=SQLEXPRESS","sa","123");
then used PreparedStatement toinsert the values to the db table.
on completion of which the servlet must passes the control by getRequestDispatcher() method to another jsp page.
bt nothing's showing, no error, no jsp page nothing.not even the data gets inserted intothe db table.
can someone please help? is it that it's a connection problem?bt then why it's not showing any error?


With regards,
rituparna
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

So, in other words, you don't know that this is a "problem connecting to sql database using jtds driver" at all. For all you know there could be a bug in your servlet code because of which your JDBC code isn't even called. Or perhaps your servlet wasn't even requested. I suggest you do some debugging until you can tell what is happening and what is not happening.
Rituparna Duttagupta
Ranch Hand

Joined: Feb 08, 2011
Posts: 55

sorry, bt it's not getting very clear to me? can you please explain?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem connecting to sql database using jtds driver