Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a database in Access or in any other RDBMS: create a small database and c

ID: 3843579 • Letter: C

Question

Create a database in Access or in any other RDBMS: create a small database and create a table having three fields :Customer NAME,Balance , and account number ,insert some data ( at least five records ). NOTE: Detailed steps should be included in the report for JDBC to a Microsoft Access database or in any other RDBMS Scenario 1 You have been asked to develop an interactive system for online banking system. The client side would accept from the user the account number and the amount of money being deposited which will then be passed on to the server. Upon receiving the data from the client, the server wi connect to the database which holds records consisting of customer name, balance and account number, and use the account number provided by the client to search the database for a matching record. Once the matching record is found, the balance will be retrieved from the database and added to the deposited amount provided by the client. The new balance will then be used to calculate the interest. The new balance and the interest will be sent back to the client where they will be displayed on screen for the user. The interest rate used would be 0.02 which is stored on the server. If a matching record is not found, send back an appropriate message such as 0 for both the balance and interest. Develop a clien server application to implement this system with the following tasks:

Explanation / Answer

User application form

<html>
<form action="credit.jsp">
<body><center><table>
<tr><td>Enter the Account No</td><td><input type="text" name="ac"></td></tr>
<tr><td>Enter the Amount</td><td><input type="text" name="amnt"></td></tr>
<tr><td><input type="submit" value="credit"></tr></td></table></center>
</body>
</form>
</html>

credit.jsp

<html>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>

<%

String acnt=request.getParameter("ac"); //getting the user input -- account number
int acno=Integer.parseInt(acnt);

String amt=request.getParameter("amnt"); //getting the user input -- amount
int iamt=Integer.parseInt(amt);

String type="Credit";

try{

// JDBC connectivity

            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            Connection con = DriverManager.getConnection("jdbc:odbc:ques");
            Statement st=con.createStatement(); // preparing to execute the statement
            ResultSet rs=st.executeQuery("select * from bank where Acno="+acno); // giving the query
            int totbal=0;

float newbal=0;
if(rs.next())
                       {
int s1=rs.getInt(2); // taking the balance from the database    totbal=s1+iamt;

newbal=totbal+totbal*0.02;

}
else
{
totbal=0;
}

PreparedStatement pstmt = con.prepareStatement("update bank set balance=? where Acno="+acno);
pstmt.setInt(1,newbal);
int i = pstmt.executeUpdate();
  ResultSet rs=stmt.executeQuery("select * from bank where Acno="+acno);

while(rs.next())

{

%>

<tr><td>Account No:<%rs.getInt(3); %></td></tr> // printing the account number and the new balance to the client

<tr><td>New Balance<%rs.getInt("2"); %></td></tr>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote