>> Delete Reply from No. 48614 article
No. RE: java 에서 jdbc[mysql] 연결 하는 방법좀 가르쳐
주세요

등록 2002-05-08 19:24:00 By localhost     조회 2
이름 pok    

		:  String db_url = "jdbc:mysql://localhost/blue";
--> String db_url = "jdbc:mysql://localhost<U>:3306</U>/blue"
 mysql 사용 포트번호를 안적으신듯..
 : [에러 메세지]
:
: org/gjt/mm/mysql/Driver
: java.sql.SQLException: driver not found: jdbc:mysql://localhost/xxx
:
: 
:
: [코드]
:
: try
:  {
:      Class.forName("org.gjt.mm.mysql.Driver");
:  }
:  catch(ClassNotFoundException e){System.out.println(e.getMessage());}
:
:  String db_url = "jdbc:mysql://localhost/blue";
:  Connection Conn = DriverManager.getConnection(db_url,"###","###");
:
:  Statement stmt = Conn.createStatement();
:  ResultSet rs = stmt.executeQuery("select title from test  limit 3");
:   while (rs.next()) {
:    System.out.println(new String(rs.getString(1)));
:   }
:
:
: 
:
: 
:
: // 머가 문제인지 잘 모르겠어요
:
: 드라이버는...{JavaHome}/jre/lib/ext 에설치 되 있어요--봄이다.. 하늘이 뿌연 봄..
[관리자] 패스워드를 입력 하십시오. 답장이 존재하면 함께 삭제됩니다.[ 목록 | 이전 ]
패스워드:    

Copyleft 1999-2026 by JSBoard Open Project
Theme Designed by IDOO All right reserved