가장 좋은 방법은 데이터베이스를 통해 이루어질 것입니다.
당신은 DB에 대해 많은 날 올바른 방향으로의
먼저 당신을 가리킬 수 있도록 잘 모릅니다 언급 한 이후 모든 설치 XAMPP 당신은 JDBC 드라이버를 설치해야
(이 당신이 당신의 로컬 컴퓨터에 MySQL 데이터베이스를 만들 수 있습니다) 당신의 IDE에 더 많거나 적은 양식을 가지고 당신이 다른 클래스에 SaveActionPerformed을 만들 수있는이 일
public class SQLConnect
{
public static Connection ConnectDb()
{
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection conn = null;
try {
conn = DriverManager.getConnection("jdbc:mysql://localhost/w1283057", "root", "");
} catch (SQLException ex) {
Logger.getLogger(SQLConnect.class.getName()).log(Level.SEVERE, null, ex);
}
return conn;
}
catch (ClassNotFoundException e)
{
System.out.println("not connected");
e.printStackTrace();//print extra info if error is thrown
return null;
}
}
}
(같은 클래스를 생성하여 프로젝트에서
을 (또는 넷빈즈 것은 당신이 사용하는 어떤 일식) 테이블 w hatever)
그것은이 같은 (당신이는 SQLConnect 클래스와 연결을하고 데이터베이스에 데이터를 삽입하는 경우 희망
public class Something extends javax.swing.JFrame
{
Connection conn = null; //A connection (session) with a specific database
ResultSet rs = null; //A table of data representing a database result set, which is usually generated by executing a statement that queries the database.
PreparedStatement pst = null; //An object that represents a precompiled SQL statement.A SQL statement is precompiled and stored in that object
private void SaveActionPerformed(jawa.awt.event.ActionEvent evt)
{
try{
conn = SQLConnect.ConnectDb();
//inserting all values to database
String sql = "INSERT INTO bla"
+ "(foo, foo1, foo2, foo3, foo4, etc"
+ "VALUES (?, ?, ?, ?, ?)";
pst = conn.prepareStatement(sql);
//Than you take all values from the fields and put them into db
// i.e. You have field name Mark. In order to put this into db you need
pst.setString(1, Mark); <- this means that preparestatement will put whatever is in the mark into first column.
pst.executeUpdate(); <- order to execute
}
이는 바른 길에 당신을 둘 곳없는이 제발 보일 수 있습니다
데이터베이스라고 생각합니다. 로컬 MySQL 데이터베이스를 실행할 수 있도록 XAMPP를 설치하십시오. 적절한 테이블을 작성하십시오. 그런 다음 SaveActionPerformed를 수행하고 해당 메소드에 필드에 삽입 된 모든 값을 로컬 DB에 전달할 수 있습니다. –
이 시스템을 사용 하시겠습니까? –
데이터베이스가 현명 할 것입니다 ... 아마도 XML로 멀리 떨어져 나가고 정말로 원한다면 Excel을 수행 할 수 있습니다. –