Solved

Servlets and Databases (msterjev  again) and the other experts

Posted on 2002-04-06
2
131 Views
Last Modified: 2013-11-24
I did not say it was wrong msterjev.

The thing is I am trying to insert one value into 2 tables contained in the database after checking whether it already exist or not and then give a message if it does or continue adding to the two specified tables in the servlet code. eg if a name is entered in the html page . the servlet should be able to add it into the two tables. I quite aware that you can be helpful again. Sample codes will be appreciated.

And (msterjev) thank you for the loggin servlet sample code which can be easily understood.

Thank

You
0
Comment
Question by:wbmorapedi
  • 2
2 Comments
 
LVL 3

Expert Comment

by:msterjev
Comment Utility
Could you remaind me which code I gave to you was wrong, and what is problem with that code?
0
 
LVL 3

Accepted Solution

by:
msterjev earned 20 total points
Comment Utility
I think this can help you:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          Connection connection=DriverManager.getConnection("jdbc:odbc:Imenik");
          Statement statement=connection.createStatement();
statement.executeUpdate("INSERT INTO Table1 VALUES(....));
statement.executeUpdate("INSERT INTO Table2 VALUES(....));
statement.close();
connecitonc.close();


You can transfer user's data across the servlets using Session.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
powerN  challenge 3 46
wordappend challenge 8 82
Unable to start eclipse ? 17 82
bitbucket vs gitbucket 3 28
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now