Credit card management System

Source: Internet
Author: User
Tags stmt

Did one weeks, finally put the credit card management system finished, the mood is very good, now want to go back to experience the whole process:

Difficulties:

1. Configuring JDBC in Jbuiler

2.server 2000 due to no SP4 patch, 1433 port is turned off, causing the connection database to not be on

Solution:

error when creating data library connections:
"Java.lang.ClassNotFoundException:com.microsoft.jdbc.sqlserver.SQLServerDriver"

A: Check the following steps:
1. Whether the installation of the data library drivers is in accordance with the normal procedures. There is no error message in the installation.
2. Whether the CLASSPATH environment variable is required to join the data library driver. jar files (MSUTIL.JSR, Msbase.jar, Mssqlserver.jar).
3. Copy the required. jar file for the data library driver to the JDK's jre/lib/ext/. If it is a jsp/servlet program, please copy the library driver's required. jar file to the Web server's Lib catalogue, for example: Copy to Tomcat's common/lib/(Tomcat needs to be restarted).
4. Reboot or reactivate the Web server.

Java code public class Cardconnect to connect to the SQL Server database ... {
private static Cardconnect dbconn=new cardconnect ();

Public Cardconnect () ... {
Try ... {
Class.forName ("Com.microsoft.jdbc.sqlserver.SQLServerDriver");
}catch (classnotfoundexception ee) ... {

}
}

public static Connection Getconn () throws SQLException ... {
String url = "Jdbc:microsoft:sqlserver://localhost:1433;databasename=card_account";
String username= "SA";
String password= "Test";
Return drivermanager.getconnection (Url,username,password);
}

public static void Close (ResultSet rs) ... {
Try ... {
Rs.close ();
}
catch (Exception ex) ... {
}
}

public static void Close (Statement stmt) ... {
Try ... {
Stmt.close ();
}
catch (Exception ex) ... {
}
}

public static void Close (Connection conn) ... {
Try ... {
Conn.close ();
}
catch (Exception ex) ... {
}
}
}

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.