netbean,database
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   jan_dav
Posted On:   Sunday, April 8, 2007 05:04 PM


Iam using NETBEAN to creat web application follow JSP + Struts + database


So what should I do, I can connect to Mysql


Thanks your in advance

Re: netbean,database

Posted By:   Anonymous  
Posted On:   Monday, May 7, 2007 09:21 PM


I am also using MySQL database but not for Web Application. For a general application. This is my step:



1. Download the MySQL JDBC Driver from MySQL.com, or ask GOOGLE and he will definitely answer.


2. Insert the .jar file to the project library. I do this by right-click in Libraries tree, choose ADD JAR file


3. use this code:





Class.forName(com.jdbc.mysql.Driver).newInstance;
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/mydata?user=me&password=secret");
Statement stat = conn.createStatement();






and the statement is ready to use.


--------------


Sorry for any error....
About | Sitemap | Contact