In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to configure J2EE to support Mysql". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's ideas to study and learn "how to configure J2EE to support Mysql".
First of all, of course, the installation of the system environment software, I will not say more, below I give the download address of several kinds of software. What needs to be emphasized is that be sure to pay attention to the version of Mysql you installed, we usually use the version of "mysql-shareware-3.22.30-win", but J2EE needs more than 3.23.15 Mysql, which is a lesson I learned in most of the day.
After many experiments, the configuration file default properties of J2EE should be set as follows:
Jdbc.drivers=org.gjt.mm.mysql.Driver
Jdbc.datasources=jdbc/TestDb | jdbc:mysql://localhost:3306/test?user=jian&password=jian
The above statement is very simple, and people who have used Mysql's jdbc driver can see it at a glance. What they should note is that the "jdbc/TestDb" is actually the name that JNDI uses to identify the database.
It's easy to call it in EJB:
DataSource ds = (DataSource) ic.lookup ("jdbc/TestDb")
In fact, after the correct configuration, looking back, I think it is really very simple, but it is a period of exploration before the correct journey that consumed me a lot of energy, the so-called pre-dawn darkness.
From the point of view of my use, the error prompt mechanism of this version of J2EE is so poor that it looks confused and unstable. For example, the JAR package generated by its assembly tool, although available, is always warned by the system pop-up window that it is an "invalid Windows NT image", which is annoying. Moreover, it is obvious that the EJB connected to Mysql can run smoothly according to my above configuration. But error.log and dos windows always say "Cannot find principal mapping information for data source with JNDI name jdbc/TestDb". However, although there are warning and error logs, as long as your program runs smoothly, you can ignore it. After all, J2EE is still a new thing and has not been widely evaluated and used for a long time.
Operation environment
Platform: Winnt 4.0
J2EE: JavaTM 2 SDK, Enterprise Edition Version 1.2.1
JDK: j2sdk1.3.0
Mysql: mysql-3.23.23-beta-win
Driver: mm.mysql-2.0.2 [@ more@]
Thank you for reading, the above is the content of "how to configure J2EE to support Mysql". After the study of this article, I believe you have a deeper understanding of how to configure J2EE to support Mysql, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.