http://www.lifesbizzare.blogspot.com || OCJP:81%
http://www.lifesbizzare.blogspot.com || OCJP:81%
Anshuman Chakraborty
Vishal Hegde wrote:Hi Bear,
I have a Jsp page having add hyperlink.Once clicked it redirects to a JSP page where i input name email address and all and once clicked on submit button the form action attribute is set to go to prepared_statement_query servlet to add the values in the database...
I was hoping that select statement in SQL query will display new values i inputted in the jsp page.but no luck the table remains the same and is not added with any new information![]()
reddy ajay wrote:
Vishal Hegde wrote:Hi Bear,
I have a Jsp page having add hyperlink.Once clicked it redirects to a JSP page where i input name email address and all and once clicked on submit button the form action attribute is set to go to prepared_statement_query servlet to add the values in the database...
I was hoping that select statement in SQL query will display new values i inputted in the jsp page.but no luck the table remains the same and is not added with any new information![]()
did you create the database in mysql and the table,
if you did not the you need to do that first.
Also debug it using debugger and see what is happening
is it running fine or is it raising some exception.
let me know
http://www.lifesbizzare.blogspot.com || OCJP:81%
Anshuman Chakraborty wrote:Hi,
Did you check Container's log file.
Suggestion :
Try printing the values you receive from JSP.
http://www.lifesbizzare.blogspot.com || OCJP:81%
Vishal Hegde wrote:
Offcourse i Created the table did you read the code for connecting my database to the table?![]()
![]()
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Regards,
Deepakkumar Devarajan
James Sabre wrote:
Vishal Hegde wrote:
Offcourse i Created the table did you read the code for connecting my database to the table?![]()
![]()
There is no 'of course' about it. Nothing in the code you posted creates the database or the table 'customer' or sets up the data source 'VirtualClassRoom' linking JDBC with ODBC.
There are some other weaknesses -
1) you are relying on a particular table column order which is not a good idea; you should specify the column names when using an insert.
2) your exception handling is very very poor.
3) there is no explicit commit() and there is no indication as to whether or not you are using auto-commit (I have not use the JDBC-ODBC bridge for a long time and I can't remember whether or not auto-commit matters).
As has been said - find the log files and see what they say.
http://www.lifesbizzare.blogspot.com || OCJP:81%
Vishal Hegde wrote:
I have created a Customer table using select statment in MS -SQL did database connectivity going to control panel->Administratitve tools-->DataSourcesODBC) And added a user DSN named "VirtualClassRoom"
Also created a VirtualClassRoom database in MSSQL and added a table customer on it added one column to test for login authentication and its working fine... and now for insertin the value i am facing this problem
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
James Sabre wrote:
Vishal Hegde wrote:
I have created a Customer table using select statment in MS -SQL did database connectivity going to control panel->Administratitve tools-->DataSourcesODBC) And added a user DSN named "VirtualClassRoom"
Also created a VirtualClassRoom database in MSSQL and added a table customer on it added one column to test for login authentication and its working fine... and now for insertin the value i am facing this problem
Since it's not obvious to me from the above that you did, did you add columns for user name, password, full name and login type etc? Also, did you check the servlet logs to see what they say? The logs should tell you exactly what the problem is.
http://www.lifesbizzare.blogspot.com || OCJP:81%
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Consider Paul's rocket mass heater. |