Netbeans의 더비 데이터베이스로 자바 프로젝트를 내보내려면 어떻게해야합니까? 다른 컴퓨터에서 가져 오기 프로젝트를 마친 후에는 구성없이 작동하고 싶습니다.Netbeans의 더비 데이터베이스로 프로젝트 내보내기
0
A
답변
2
응용 프로그램에 가장 기본적인 설치는 매우 쉽습니다. 정말로 라이브러리/항아리를 클래스 경로에 배치하는 것입니다. Netbeans에는 이미이 라이브러리가 함께 제공되므로 다운로드 할 필요가 없습니다. 어떤 이유인지 모르면 here에서 다운로드 할 수 있습니다. 압축을 푼 후 derby.jar
(및 필요한 경우 다른 사람)을 클래스 경로에 추가하기 만하면됩니다.
기본적으로 Netbeans의 프로젝트에서 [라이브러리]를 마우스 오른쪽 버튼으로 클릭하고 [라이브러리 추가]를 선택하십시오.
그런 다음 당신이 다음 대신 [라이브러리 추가]의 라이브러리를 다운로드 한 경우 [항아리 추가]를 선택하고 [자바 DB] 라이브러리
을 선택하고 검색 당신이 그것을 다운로드 한 항아리.
이
그런 다음 응용 프로그램에서 데이터베이스를 사용할 수있는 넷빈즈 라이브러리와 함께 제공되는 항아리입니다. 임베디드 버전은 애플리케이션과 동일한 JVM에서 실행되기 때문에 직접 데이터베이스 시작 및 종료를 처리해야 할 수 있습니다. 다음은 시작되는 예제 응용 프로그램입니다 - createsdb-inserts-select-shutsdown. 우리가 그것을 만들 때
import java.sql.*;
public class DerbyProject {
public static void main(String[] args) throws Exception {
/* ------- Start DB ----------- */
final String driver = "org.apache.derby.jdbc.EmbeddedDriver";
Class.forName(driver).newInstance();
final String protocol = "jdbc:derby:";
final String dbName = "derbyDB";
Connection connection = DriverManager.getConnection(
protocol + dbName + ";create=true");
System.out.println("===== Started/Connected DB =====");
/*
* Drop table for testing. If we don't drop, running the
* same program will fail, if we start our application over
* as the new table has been persisted
*/
final String dropSql = "drop table users";
Statement statement = connection.createStatement();
try {
statement.execute(dropSql);
System.out.println("===== Dropped Table 'users' =====");
} catch (SQLException e) {
if (!e.getSQLState().equals("42Y55")) {
throw e;
}
}
/* ----- Creeate 'users' table ----- */
final String createSql = "create table users (id int, name varchar(32))";
statement.execute(createSql);
System.out.println("===== Created Table 'users' =====");
/* ----- Insert 'peeskillet' into 'users' ----*/
final String insertSql = "insert into users values (1 , 'peeskillet')";
statement.execute(insertSql);
System.out.println("===== inserted 'peeskillet into 'users' =====");
/* ----- Select from 'users' table ----- */
final String selectSql = "select name from users where id = 1";
ResultSet rs = statement.executeQuery(selectSql);
if (rs.next()) {
System.out.println("===== Selected from 'users' with id 1 \n"
+ "\t\t\t result: " + rs.getString("name") + " =====");
}
/* ------ Shut Down DB ------- */
try {
DriverManager.getConnection("jdbc:derby:;shutdown=true");
} catch (SQLException se) {
if (((se.getErrorCode() == 50000)
&& ("XJ015".equals(se.getSQLState())))) {
System.out.println("Derby shut down normally");
} else {
System.err.println("Derby did not shut down normally");
throw se;
}
}
statement.close();
rs.close();
connection.close();
}
}
, 넷빈즈의 기본 빌드는 dist\lib
에 항아리를 넣고 MANIFEST.MF
의 클래스 경로에 그 항아리를 넣어해야합니다. 당신은 당신이 파일이 넷빈즈에서 볼 열 경우 데이터가 실제로 저장되는 위치, 당신이 볼 수있는 그
을 테스트하기 위해 명령 줄에서 항아리를 실행할 수 있습니다.
: 더비 더비 튜토리얼에 대한 자세한 내용은관련 문제
- 1. MYSQL 테이블을 더비 데이터베이스로 전송하는 방법은 무엇입니까?
- 2. NetBeans의 Jar 파일 내보내기
- 3. NetBeans의 Pure-JavaScript 프로젝트?
- 4. Netbeans의 중복 JavaFX 프로젝트
- 5. Excel에서 SQL 데이터베이스로 선택적 내보내기
- 6. SqlAlchemy : 테이블을 새 데이터베이스로 내보내기
- 7. ASPNETDB 데이터를 다른 데이터베이스로 내보내기
- 8. 선택한 항목을 SQL 데이터베이스로 내보내기
- 9. MSSQL에서 H2 데이터베이스로 데이터 내보내기
- 10. ASP.net 데이터를 MySQL 데이터베이스로 내보내기
- 11. TestNG 생성 결과를 데이터베이스로 내보내기
- 12. 단어 파일의 필드 추출 및 데이터베이스로 내보내기
- 13. 더비 +는 + 스프링 MVC
- 14. mysql 데이터베이스로 Rails 프로젝트 구성하기
- 15. Android 라이브러리 프로젝트 - 내보내기
- 16. 웹 프로젝트 내보내기
- 17. Eclipse에서 폴더로 프로젝트 내보내기
- 18. 라이브러리를 사용하여 프로젝트 내보내기
- 19. BaseCamp 전체 프로젝트 내보내기
- 20. IntelliJ에서 .jar로 프로젝트 내보내기
- 21. Paw 클라우드에서 프로젝트 내보내기
- 22. RazorSQL는 더비
- 23. 더비 데이터베이스
- 24. Netbeans의 다른 프로젝트 파일간에 차이점이 있습니다.
- 25. netbeans의 classLoader를 가져 오는 방법 프로젝트 지정
- 26. 무엇이 중요한 파일 netbeans의 폴더 프로젝트
- 27. 파워 포인트에서 액세스 데이터베이스로 데이터 내보내기
- 28. BigQuery에서 로컬 PostgreSQL/MySql 데이터베이스로 데이터 내보내기
- 29. 폼에서 데이터베이스로 데이터 내보내기 (PHP/MySQL)
- 30. 하나의 데이터베이스에서 다른 데이터베이스로 내보내기/가져 오기