Solved

Servlets and Databases (msterjev  again) and the other experts

Posted on 2002-04-06
2
134 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
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 20 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
eclipse apache tomcat admin console 52 123
ejb on wildfly 5 30
eclipse console opening separately 2 29
Java class and jar 3 25
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.

820 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