In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to connect myeclipse and navicat, the article is very detailed, has a certain reference value, interested friends must read it!
To connect myeclipse to navicat:
1. Install mysql
two。 Install myeclipse
3. Install the mysql visual interface Navicat
4. Download JDBC driver download address https://dev.mysql.com/downloads/connector/j/
5. Configure connections (focus)
1 > put the JDBC driver in the lib package under the new project (if you don't have this folder, create it yourself), and then set it into the environment (right-click the jar file and Build Path).
2 > Open myeclipse-Window-perspective-Open Perspective-Myeclipse Database Explorer.
3 > right-click on the blank version on the right after opening it. Configuration information is required when the following screen appears.
4 > configuration information is as follows:
(note two points: 1.jdbc:mysql:// [] / to modify the 2.Driver classname, choose the following one)
Then if Test Driver succeeds, then Finish.
5 > write java code to access the database.
Public class DBUtil {private static final String URL= "jdbc:mysql://127.0.0.1:3306/testdatabase"; private static final String USER= "root"; private static final String PASSWORD= ""; public static void main (String [] args) throws Exception {/ / TODO Auto-generated method stub//1. Load the driver Class.forName ("com.mysql.jdbc.Driver"); / / 2. Get the database connection Connection conn=DriverManager.getConnection (URL, USER, PASSWORD); / / 3. Operate the database through the connection of the database to add, delete, modify and query Statement stmt = conn.createStatement (); ResultSet rs=stmt.executeQuery ("select user_name,age from goddess where id=1"); while (rs.next ()) {System.out.print ("user_name") + "," + rs.getInt ("age");}}
The database is shown in the figure:
Finally, the java code was run successfully.
The above is all the contents of the article "how to connect myeclipse to navicat". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.