'분류 전체보기'에 해당되는 글 663건

  1. 2007.12.18 자바 (Java)로 MySQL에서 테이블 (Table)에 한글 데이터 입력하기 by 알 수 없는 사용자 1
  2. 2007.12.18 MySQL에서 테이블 (Table)에 데이터 입력하기 by 알 수 없는 사용자
  3. 2007.12.18 MySQL에서 테이블 (Table) 생성하기 by 알 수 없는 사용자
  4. 2007.12.18 MySQL에서 사용자 (User) 추가하기 by 알 수 없는 사용자
  5. 2007.12.18 MySQL에서 데이터베이스 (Database) 생성하기 by 알 수 없는 사용자
  6. 2007.12.17 이클립스 (Eclipse)에서 코딩 스타일 (Code Style) 수정하기 by 알 수 없는 사용자 1
  7. 2007.12.17 이클립스 (Eclipse)에서 자동 들여쓰기 (Indentation) 수정하기 by 알 수 없는 사용자 2
  8. 2007.12.15 Atom (standard) by 알 수 없는 사용자
  9. 2007.12.15 Web syndication by 알 수 없는 사용자
  10. 2007.12.15 Podcast by 알 수 없는 사용자

다음은 vsms라는 데이터베이스 내에 test라는 테이블에 한글 데이터를 넣는 예제 프로그램이다.

import java.sql.*;

public class MySQLKoreanInsertDemo {
 public static void main(String[] args) {
  try {
   Class.forName("com.mysql.jdbc.Driver").newInstance();
  } catch (ClassNotFoundException e) {
   System.err.println(e);
  } catch (InstantiationException e) {
   System.err.println(e);
  } catch (IllegalAccessException e) {
   System.err.println(e);
  }

  String server = "localhost";
  String dbname = "vsms";
  String username = "user1";
  String password = "passwd1";

  String url = "jdbc:mysql://" + server + "/" + dbname
    + "?user=" + username
    + "&password=" + password
    + "&useUnicode=true&characterEncoding=euc_kr";

  try {
   Connection conn = DriverManager.getConnection(url);
   Statement stmt = conn.createStatement();

   String query = "INSERT INTO test (data) VALUES ('임정묵')";

   stmt.executeUpdate(query);

   stmt.close();
   conn.close();
  } catch (SQLException e) {
   System.err.println(e);
  }
 }
}


위에서 "&useUnicode=true&characterEncoding=euc_kr"가 필요함에 유의한다.

Posted by 알 수 없는 사용자
,

다음은 test라는 테이블에 data 값으로 '임정묵'이라는 값을 입력하는 명령이다.

INSERT INTO test (data) VALUES ('임정묵');

Reference:
http://dev.mysql.com/doc/refman/5.0/en/insert.html
Posted by 알 수 없는 사용자
,

다음은 test라는 이름의 테이블을 생성하는 명령이다.

CREATE TABLE test (
 data VARCHAR(255)
);

이 테이블을 255개의 문자를 담을 수 있는 data라는 이름의 필드를 포함한다.

Reference:
http://dev.mysql.com/doc/refman/5.0/en/create-table.html
Posted by 알 수 없는 사용자
,

다음은 vsms라는 데이터베이스의 모든 테이블에 대해 모든 권한을 사용할 수 있는 user1이라는 사용자를 추가하는 명령이다. 이 사용자는 암호로 passwd1을 사용하고, 로컬 접속뿐만 아니라 원격 접속도 가능하도록 설정하고 있다.

GRANT ALL PRIVILEGES ON vsms.* TO 'user1'@'localhost' IDENTIFIED BY 'passwd1' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON vsms.* TO 'user1'@'%' IDENTIFIED BY 'passwd1' WITH GRANT OPTION;

Reference:
http://dev.mysql.com/doc/refman/5.0/en/adding-users.html
Posted by 알 수 없는 사용자
,

CREATE DATABASE db_name;


ex. CREATE DATABASE vsms;

Reference:
http://dev.mysql.com/doc/refman/5.0/en/create-database.html

Posted by 알 수 없는 사용자
,

들여쓰기는 이전에 알아보았고,

소스 코드를 구했으나 코드 스타일이 마음에 안든다면 어떻게 해야할까?

가령, 괄호의 위치처럼.

역시 수작업으로 수정하고 있자니 시간이 아깝다.

그럴 땐 Format 기능을 활용한다.

이클립스에서는 다음과 같은 방법으로 할 수 있다.

소스 파일을 Ctrl + 'a'로 전체 선택하고,

마우스 오른쪽 버튼을 누른다.

Source -> Format을 선택한다.

기본적으로 제공되는 코드 스타일이 마음에 들지 않는다면,

프로젝트의 Properties 대화상자를 띄워서

Java Code Style - Formatter를 수정한다.

Posted by 알 수 없는 사용자
,

들여쓰기에 대한 결벽증을 가진 프로그래머라면,

들쑥날쑥한 코드의 들여쓰기가 탐탁치 않을 것이다.

그렇다고 수작업으로 들여쓰기를 수정하고 있자니 시간은 아깝다.

그럴 때 자동 들여쓰기 수정 기능을 활용한다.

이클립스에서는 다음과 같은 방법으로 할 수 있다.

소스 파일을 Ctrl + 'a'로 전체 선택하고,

마우스 오른쪽 버튼을 누른다.

Source -> Correct Indentation을 선택한다.
Posted by 알 수 없는 사용자
,

Atom (standard)

Computer/Terms 2007. 12. 15. 13:18

The name Atom applies to a pair of related standards. The Atom Syndication Format is an XML language used for web feeds, while the Atom Publishing Protocol (referred to as AtomPub for short) is a simple HTTP-based protocol for creating and updating web resources.

Web feeds allow software programs to check for updates published on a web site. To provide a web feed, a site owner may use specialized software (such as a content management system) that publishes a list (or "feed") of recent articles or content in a standardized, machine-readable format. The feed can then be downloaded by web sites that syndicate content from the feed, or by feed reader programs that allow Internet users to subscribe to feeds and view their content.

A feed contains entries, which may be headlines, full-text articles, excerpts, summaries, and/or links to content on a web site, along with various metadata.

The development of Atom was motivated by the existence of many incompatible versions of the RSS syndication format, all of which had shortcomings, and the poor interoperability, of XML-RPC-based publishing protocols. The Atom syndication format was published as an IETF "proposed standard" in RFC 4287, and the Atom Publishing Protocol was published as RFC 5023.


Reference:
http://en.wikipedia.org/wiki/Atom_%28standard%29

Posted by 알 수 없는 사용자
,

Web syndication

Computer/Terms 2007. 12. 15. 13:07

Web syndication is a form of syndication in which a section of a website is made available for other sites to use. This could be simply by licensing the content so that other people can use it; however, in general, web syndication refers to making web feeds available from a site in order to provide other people with a summary of the website's recently added content (for example, the latest news or forum posts).

Large scale web syndication of content started in 2001 when Miniclip freely syndicated online, browser-based, interactive games to the masses. Today many different types of content are syndicated on the Internet. Millions of online publishers, including newspapers, commercial websites and blogs, now publish their latest news headlines, product offers or blog postings in standard format news feed.

Syndication benefits both the websites providing information and the websites displaying it. For the receiving site, content syndication is an effective way of adding greater depth and immediacy of information to its pages, making it more attractive to users. For the transmitting site, syndication drives exposure across numerous online platforms. This generates new traffic for the transmitting site — making syndication a free and easy form of advertisement.

The prevalence of web syndication is also of note to online marketers, since web surfers are becoming increasingly wary of providing personal information for marketing materials (such as signing up for a newsletter) and expect the ability to subscribe to a feed instead.

Although the format could be anything transported over HTTP, such as HTML or JavaScript, it is more commonly XML. The two main families of web syndication formats are RSS and Atom.


Reference:
http://en.wikipedia.org/wiki/Web_syndication

Posted by 알 수 없는 사용자
,

Podcast

Computer/Terms 2007. 12. 15. 12:42

A podcast is a collection of digital media files which is distributed over the Internet using syndication feeds for playback on portable media players and personal computers. The term, like "radio", can refer either to the content itself or to the method by which it is syndicated; the latter is also termed podcasting. The host or author of a podcast is often called a podcaster.

The term "podcast" is a portmanteau of the words "iPod" and "broadcast", the Apple iPod being the brand of portable media player for which the first podcasting scripts were developed. These scripts allow podcasts to be automatically transferred to a mobile device after they are downloaded.

Though podcasters' web sites may also offer direct download or streaming of their content, a podcast is distinguished from other digital media formats by its ability to be syndicated, subscribed to, and downloaded automatically when new content is added, using an aggregator or feed reader capable of reading feed formats such as RSS or Atom.


Reference:
http://en.wikipedia.org/wiki/Podcast

Posted by 알 수 없는 사용자
,