Compound Interest Calculation-pairs (linked database)

Source: Internet
Author: User
Tags comparison table

Knot Pair Companion Blog Park address:

: Guo Zhihao

http://home.cnblogs.com/u/gzh13692021053/

The project completion estimate and the actual completion comparison table are as follows:

Estimated time to find information (h) 3
Time to find material time (h) 4
Estimate team Discussion time (h) 2
Time Team Discussion time (h) 2
Estimated programming Time (h) 5
Actual programming time (h) 7
Estimated time to complete (h) 9
Actual completion time (h) 12

View related Information link: http://www.2cto.com/kf/201405/298386.html

GitHub Address: Https://github.com/Sub-key/1/tree/master/fulitest

Main code:

Enter the data into MySQL:

public void Dmysql (double p,int n,double r,int m,double F) throws ClassNotFoundException, sqlexception{
String name = "Root";
String pwd = "123456";
String url = "Jdbc:mysql://localhost_3306/fulisql";
try{
Class.forName ("Com.mysql.jdbc.Driver");
Class.forName ("Org.gjt.mm.mysql.Driver");
}catch (ClassNotFoundException e)
{
E.printstacktrace ();
}
Connection conn = drivermanager.getconnection ("Jdbc:mysql://localhost/fulisql", "root", "123456");
Statement stmt = Conn.createstatement ();
String SQL1 = "INSERT INTO Fuli (p,n,r,m,f) VALUES (?,?,?,?,?)";
PreparedStatement pstmt = conn.preparestatement (SQL1);
Pstmt.setdouble (1,P);
Pstmt.setint (2,n);
Pstmt.setdouble (3,R);
Pstmt.setint (4,M);
Pstmt.setdouble (5,F);
Pstmt.executeupdate ();
Pstmt.executeupdate ();
Stmt.close ();
Conn.close ();

}
}

Output data from the database:

public class Test1_1 {
public static void Server (double p,int N, double R, int M, double F)
Throws SQLException, ClassNotFoundException {
String name = "Root";
String pwd = "123456";
String url = "Jdbc:mysql://localhost:3306/fulisql";

Class.forName ("Com.mysql.jdbc.Driver");
Class.forName ("Org.gjt.mm.mysql.Driver");

Connection conn = drivermanager.getconnection ("Jdbc:mysql://localhost/fulisql", "root", "123456");
Statement stmt = Conn.createstatement ();
String sql = "SELECT * from Fuli";
ResultSet rs = stmt.executequery (SQL);
while (Rs.next ()) {
p = rs.getdouble ("P");
n = rs.getint ("n");

r = rs.getdouble ("R");

m = Rs.getint ("M");
f = rs.getdouble ("f");
System.out.println (P + "\ T" + R + "\ T" + N + "\ T" + M + "\ T" + F);
}
Rs.close ();
Stmt.close ();
Conn.close ();
}

}

Experimental results:

Cooperation Photo:

Compound Interest Calculation-pairs (linked database)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.