[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Servlets and Databases (msterjev  again) and the other experts

Posted on 2002-04-06
2
Medium Priority
?
138 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 3

Expert Comment

by:msterjev
ID: 6922973
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 80 total points
ID: 6923122
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 to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

649 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